Skip to content

update base image

update base image #106

Workflow file for this run

name: Docker Build, Push
on:
push:
branches:
- '*'
tags-ignore:
- 'release/*'
jobs:
docker:
env:
IMAGE: img.hephy.pro/fluxcd/flux-pr-review
runs-on: self-hosted
steps:
- name: Prepare
id: prep
run: |
BRANCH=${GITHUB_REF##*/}
TS=$(date +%s)
REVISION=${GITHUB_SHA::8}
BUILD_ID="${BRANCH}-${REVISION}-${TS}"
LATEST_ID=canary
if [[ $GITHUB_REF == refs/tags/* ]]; then
BUILD_ID=${GITHUB_REF/refs\/tags\//}
LATEST_ID=latest
fi
echo BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') >> $GITHUB_OUTPUT
echo BUILD_ID=${BUILD_ID} >> $GITHUB_OUTPUT
echo LATEST_ID=${LATEST_ID} >> $GITHUB_OUTPUT
#- name: Set up QEMU
# uses: docker/setup-qemu-action@v1
#- name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: img.hephy.pro
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- uses: actions/checkout@v3
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ env.IMAGE }}:${{ steps.prep.outputs.BUILD_ID }}
${{ env.IMAGE }}:${{ steps.prep.outputs.LATEST_ID }}
#cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
#cache-to: type=registry,ref=${{ env.IMAGE}}:buildcache,mode=max
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}