docker-node-red/.github/workflows/build.yaml
James Andariese a8697f41da
All checks were successful
Build and push nixos-based docker container / build (push) Successful in 17s
faster uploads, including the branch name
2024-08-04 01:23:58 -05:00

30 lines
855 B
YAML

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 .#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