-
Notifications
You must be signed in to change notification settings - Fork 190
56 lines (49 loc) · 1.54 KB
/
docker-dev.yml
File metadata and controls
56 lines (49 loc) · 1.54 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
name: docker-dev
on:
workflow_dispatch: # manually run
inputs:
custom_tag:
description: 'Custom tag to use for the image (defaults to commit hash if empty)'
required: false
images:
description: 'Space-separated list of images to publish (leave empty for all)'
required: false
tag_latest:
description: 'Also publish image with the latest tag'
type: boolean
default: true
required: false
env:
CI: true
jobs:
publish:
name: docker-dev-publish
runs-on: ubuntu-latest
steps:
- name: Docker login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
use: true
- name: Checkout
uses: actions/checkout@v4
- name: Get commit short SHA
id: commit_sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and Publish
run: |
CUSTOM_TAG="${{ inputs.custom_tag }}"
if [ -z "$CUSTOM_TAG" ]; then
CUSTOM_TAG="${{ steps.commit_sha.outputs.sha }}"
fi
TAG_LATEST="${{ inputs.tag_latest }}"
IFS=' ' read -r -a image_array <<< "${{ inputs.images }}"
./ops/docker-publish-dev.sh "$CUSTOM_TAG" "$TAG_LATEST" "${image_array[@]}"