-
Notifications
You must be signed in to change notification settings - Fork 14
57 lines (52 loc) · 1.62 KB
/
publish-images.yaml
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
name: Publish Container Images (workflow_run)
on:
workflow_run:
workflows: ['Publish Container Images']
types:
- completed
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
RELEASE: ${{ github.ref_name }}
jobs:
debug-event:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Print workflow actor
run: echo "${{ toJSON(github.actor) }}"
- name: Print workflow event
run: jq '.' $GITHUB_EVENT_PATH
publish:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
os: [linux]
arch: [amd64, arm64, arm]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Import environment variables from file
run: cat ".github/env" >> $GITHUB_ENV
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule,pattern=main
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
flavor: |
suffix=-${{ matrix.arch }},onlatest=true
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata (without suffixes)
id: meta_clean
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}