Skip to content

Commit

Permalink
ci: publish container image
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramblurr committed Oct 30, 2024
1 parent 4feab6a commit 9fcb4a6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
- 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

Expand All @@ -33,15 +35,29 @@ jobs:
permissions:
id-token: write
contents: read
if: startsWith(github.ref, 'refs/tags/v')
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: "${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"
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="${{ github.repository_owner }}:${{ github.token }}" docker-archive:./result docker://ghcr.io/${{github.repository_owner}}/datomic-pro:$datomic_version
- uses: DeterminateSystems/flakehub-push@main
with:
visibility: public
name: Ramblurr/datomic-pro
tag: "${{ inputs.tag }}"
tag: "${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}"
22 changes: 22 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
ignore: |
.yamllint.yml
extends: default
rules:
truthy:
allowed-values: ["true", "false"]
line-length: disable
braces:
min-spaces-inside: 0
max-spaces-inside: 1
level: error
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
level: error
indentation:
spaces: 2
indent-sequences: consistent
new-lines: disable
comments: disable
comments-indentation: disable

0 comments on commit 9fcb4a6

Please sign in to comment.