Remove some cruft from the container image #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "The existing tag to publish to FlakeHub" | |
type: "string" | |
required: true | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- uses: DeterminateSystems/flake-checker-action@main | |
- name: Build datomic-pro nix package | |
run: nix build .#datomic-pro | |
- name: Build datomic-pro oci image | |
run: nix build .#datomic-pro-container -o container | |
- name: Run NixOS module tests | |
run: nix flake check | |
publish-unstable-image: | |
needs: check | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
# if we are on the main branch | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Build datomic-pro oci image | |
run: nix build .#datomic-pro-container -o container | |
- name: Push container image on new releases | |
run: | | |
nix develop --ignore-environment --command skopeo copy --dest-creds="ramblurr:${{ github.token }}" docker-archive:./container docker://ghcr.io/ramblurr/datomic-pro:unstable | |
publish: | |
needs: check | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
if: startsWith(github.ref, 'refs/tags/v') || inputs.tag != null | |
steps: | |
- name: Verify tag format | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
if [[ ! "${{ inputs.tag }}" =~ ^v ]]; then | |
echo "Error: Tag must start with 'v' prefix" | |
exit 1 | |
fi | |
- uses: actions/checkout@v4 | |
with: | |
ref: "${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', inputs.tag) || github.ref }}" | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Build datomic-pro oci image | |
run: nix build .#datomic-pro-container -o container | |
- name: Push container image on new releases | |
run: | | |
datomic_version=$(grep 'version = ' pkgs/datomic-pro.nix | cut -d'"' -f2) | |
nix develop --ignore-environment --command skopeo copy --dest-creds="ramblurr:${{ github.token }}" docker-archive:./container docker://ghcr.io/ramblurr/datomic-pro:$datomic_version | |
- uses: DeterminateSystems/flakehub-push@main | |
with: | |
visibility: public | |
name: Ramblurr/datomic-pro | |
tag: "${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}" |