name: Build image on: push: tags: - 'v*' jobs: build-image: container: image: catthehacker/ubuntu:act-latest env: USER: node HOME: /home/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 --group-add 988 steps: - run: | env if [ ! -f ~/.nix-profile/etc/profile.d/nix.sh ]; then curl -L https://nixos.org/nix/install | bash -s -- --no-daemon fi - name: Prep nix env run: | . ~/.nix-profile/etc/profile.d/nix.sh env >> "$GITHUB_ENV" - name: Checkout repo uses: actions/checkout@v4 - name: Get image meta run: nix build .#image-meta -o image-meta - name: Version check run: | VERSION=$(cat image-meta/version) [ "$GITHUB_REF_NAME" = v"$VERSION" ] - run: nix build --log-format raw --print-build-logs .#image -o image.tar.gz - run: nix run .#crane -- auth login -u paul -p "$PASSWORD" git.pbrinkmeier.de - run: file image.tar.gz - run: file $(readlink -f image.tar.gz) - run: zcat image.tar.gz | head - run: nix run .#crane -- push $(readlink -f image.tar.gz) $(cat image-meta/name)