docker-node-red/.github/workflows/build.yaml

30 lines
868 B
YAML
Raw Normal View History

2024-08-04 00:48:21 +00:00
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)"
2024-08-04 06:47:08 +00:00
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"
2024-08-04 00:48:21 +00:00
done