diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index 4f1259b..9193226 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -1,10 +1,12 @@ name: Build image on: - pull_request: + push: + tags: + - 'v*' jobs: build-image: - runs-on: node-22-bullseye container: + image: catthehacker/ubuntu:act-latest env: USER: node NIX_CONFIG: experimental-features = nix-command flakes @@ -20,7 +22,19 @@ jobs: 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: ls -lah + - 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)