Skip to content

Publish Multi Platform Docker Images #24

Publish Multi Platform Docker Images

Publish Multi Platform Docker Images #24

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@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
- 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.source=https://github.com/offensive-vk/Classics
- name: Install Cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@c56c2d3e59e4281cc41dea2217323ba5694b171e #v3.8.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@ca877d9245402d1537745e0e356eab47c3520991 # 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