name: Build and push nixos-based docker container on: [push] env: REGISTRY: git.strudelline.net PACKAGE: cascade/docker-node-red REGISTRY_AUTH_FILE: ./registry-auth.json jobs: build: runs-on: nix steps: - name: Check out repository code uses: actions/checkout@v4 with: fetch-depth: 1 - run: |- set -x skopeo login --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PASSWORD }} "$REGISTRY" MAINTAG="sha-$(echo "$GITHUB_SHA" | cut -c 1-8)" nix run --show-trace .#upload-image "docker://$REGISTRY/$PACKAGE:$MAINTAG" for TAG in \ "$GITHUB_REF_NAME" \ "$GITHUB_REF_NAME-$(date +%Y%m%d-%H%M%S)" \ ; do skopeo copy "docker://$REGISTRY/$PACKAGE:$MAINTAG" "docker://$REGISTRY/$PACKAGE:$TAG" done