-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (61 loc) 路 2.01 KB
/
Copy pathpublish-containers.yml
File metadata and controls
64 lines (61 loc) 路 2.01 KB
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
name: Publish Containers
permissions:
contents: read
packages: write
on:
workflow_call:
inputs:
plan:
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: 'Version tag to publish (e.g. v0.8.1)'
required: true
type: string
latest_release:
description: 'Also tag this image as latest'
required: false
type: boolean
default: false
jobs:
publish-containers:
name: Publish Container Images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Resolve version
id: version
env:
PLAN: ${{ inputs.plan }}
MANUAL_TAG: ${{ inputs.tag }}
run: |
if [[ -n "$PLAN" ]]; then
ANNOUNCEMENT_TAG="$(echo "$PLAN" | jq -r '.announcement_tag')"
echo "tag_latest=true" >> "$GITHUB_OUTPUT"
else
ANNOUNCEMENT_TAG="$MANUAL_TAG"
echo "tag_latest=${{ inputs.latest_release }}" >> "$GITHUB_OUTPUT"
fi
echo "tag=${ANNOUNCEMENT_TAG#v}" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v41.0
- name: Login to Docker Hub
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Push Container Images
env:
CONTAINER_TAG: ${{ steps.version.outputs.tag }}
PUSH_IMAGE: "true"
TAG_LATEST: ${{ steps.version.outputs.tag_latest }}
run: ./build
working-directory: ./docker