Fix semver image workflow #4
Workflow file for this run
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: Create SemVer-tagged OCI image | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: read-all | |
jobs: | |
publish-image: | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: >- # v4.1.1 | |
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Install Nix | |
uses: >- # v9 | |
DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
nix-installer-tag: v0.16.1 | |
- name: Cache Nix derivations | |
uses: >- # Custom commit, last pinned at 2024-03-03. | |
DeterminateSystems/magic-nix-cache-action@742d8701e54851d2136f71b61d31382a4f4d0788 | |
- name: Test image | |
run: | | |
nix run .#local-image-test image | |
- name: Upload image | |
run: | | |
nix run .#publish-ghcr ${{github.ref_name}} | |
env: | |
GHCR_REGISTRY: ghcr.io | |
GHCR_USERNAME: ${{ github.actor }} | |
GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
GHCR_IMAGE_NAME: ${{ github.repository }} |