Skip to content

docker

docker #188

Workflow file for this run

---
name: docker
"on":
push:
branches:
- master
paths:
- latest/*
- .github/workflows/docker.yml
pull_request:
branches:
- master
workflow_dispatch:
schedule:
- cron: 0 8 * * 1
permissions:
contents: write
packages: write
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Detect version
run: |
VER=$(sed -ne "s/^.*GITLAB_RELEASE_VERSION=\(.*\)/\1/p;" latest/Dockerfile)
echo IMAGE_TAG=${VER} >> ${GITHUB_ENV}
echo "Building ${VER}"
- name: Docker meta
id: meta
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
images: |
ghcr.io/${{ github.repository }}
flavor: |
latest=true
tags: |
type=raw,value=${{ env.IMAGE_TAG }}
type=schedule,pattern={{date 'YYYYMMDD'}}
type=ref,enable=true,event=branch
labels: |
org.opencontainers.image.vendor=Cloudpunks
maintainer=Cloudpunks GmbH <ops@cloudpunks.de>
- name: Setup QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4
- name: Setup Buildx
id: buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
- name: Ghcr login
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker build
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7
with:
builder: ${{ steps.buildx.outputs.name }}
context: latest/
file: latest/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
...