Skip to content

Initial commit

Initial commit #2

Workflow file for this run

name: Build
on:
- push
permissions:
contents: read
id-token: write
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v11
- uses: DeterminateSystems/magic-nix-cache-action@v6
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: nix build -L .#image
- uses: actions/upload-artifact@v4
with:
name: image
path: result
- name: Push image
if: github.ref_type == 'tag'
run: |
image="$(docker load -i result | awk '{print $3}')"
<<< "$TAGS" xargs -n1 docker tag "$image"
<<< "$TAGS" xargs -n1 docker push
env:
TAGS: ${{ steps.meta.outputs.tags }}