Skip to content

Publish Multi Platform Docker Images #13

Publish Multi Platform Docker Images

Publish Multi Platform Docker Images #13

Workflow file for this run

name: Publish Multi Platform Docker Images
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB: ghcr.io
GITLAB: registry.gitlab.com
DOCKERFILE: ./Dockerfile
MULTI_ARCH: true
GLCR: ${{ secrets.GLCR_SLUG }}
GHCR: ${{ secrets.GHCR_SLUG }}
GLCR_PASSWORD: ${{ secrets.GLCR_TOKEN }}
GHCR_PASSWORD: ${{ secrets.GHCR_TOKEN }}
jobs:
deploy:
runs-on: ubuntu-latest
name: Publish Images
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: |
${{ env.GHCR }}
${{ env.GLCR }}
tags: |
type=edge
flavor: |
latest=true
labels: |
org.opencontainers.image.title=classics
org.opencontainers.image.vendor=Vedansh
org.opencontainers.image.multi-platform=true
org.opencontainers.image.source=https://github.com/offensive-vk/Classics
- name: Install Cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da #v3.7.0
with:
cosign-release: 'v2.1.1'
- name: Login to Gitlab Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@3b8fed7e4b60203b2aa0ecc6c6d6d91d12c06760 # v3.0.0
with:
registry: ${{ env.GITLAB }}
username: ${{ github.repository_owner }}
password: ${{ env.GLCR_PASSWORD }}
- name: Login to Github Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB }}
username: ${{ github.repository_owner }}
password: ${{ env.GHCR_PASSWORD }}
- name: Build and Push Image
id: build-and-push
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v5.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/amd64/v2,linux/amd64/v3
- name: Verify Tags and Labels
run: |
echo "## Action Summary - Docker CI " >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.labels }} " >> $GITHUB_STEP_SUMMARY