-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 2.88 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.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@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@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