vrnp/.gitea/workflows/build-image.yml
Paul Brinkmeier 21822a0c0e
Some checks failed
Build image / build-image (push) Failing after 5s
Nix CI tryouts
2025-10-06 01:38:10 +02:00

42 lines
1.3 KiB
YAML

name: Build image
on:
push:
tags:
- 'v*'
jobs:
build-image:
container:
image: node:24-bookworm
env:
USER: node
NIX_CONFIG: experimental-features = nix-command flakes
volumes:
- /home/paul/nix-ci/nix-runner-nix:/nix
- /home/paul/nix-ci/nix-runner-etc-nix:/etc/nix
- /home/paul/nix-ci/nix-runner-home-node:/home/node
options: --user 1000:1000
steps:
- run: |
cat /var/run/act/workflow/0.sh
if [ ! -f ~/.nix-profile/etc/profile.d/nix.sh ]; then
bash <(curl -L https://nixos.org/nix/install) --no-daemon
fi
- name: Checkout repo
uses: actions/checkout@v4
- name: Get image meta
run: |
. ~/.nix-profile/etc/profile.d/nix.sh
nix build .#image-meta -o image-meta
- name: Version check
run: |
VERSION=$(cat image-meta/version)
[ "$GITHUB_REF_NAME" = v"$VERSION" ]
- run: |
. ~/.nix-profile/etc/profile.d/nix.sh
nix build --log-format raw --print-build-logs .#image -o image.tar.gz
- run: docker login -u paul -p "$PASSWORD" git.pbrinkmeier.de
env:
PASSWORD: "${{ secrets.REGISTRY_PASSWORD }}"
- run: docker load < image.tar.gz
- run: docker image push $(cat image-meta/name)