docker: pass in build-args, add $NOW

This commit is contained in:
Ralf Vogler 2023-08-27 23:32:56 +02:00
parent 2eb17a1419
commit 8a010dbcc7
3 changed files with 21 additions and 6 deletions

View file

@ -20,6 +20,11 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set environment variables
run: |
echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
@ -29,6 +34,7 @@ jobs:
-
name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
@ -44,8 +50,12 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64 # ,linux/arm/v7
push: true
build-args: |
COMMIT=${{ github.sha }}
BRANCH=${{ env.BRANCH }}
NOW=${{ env.NOW }}
platforms: linux/amd64,linux/arm64 # ,linux/arm/v7
tags: |
voglerr/free-games-claimer:latest
ghcr.io/vogler/free-games-claimer:latest