forked from temporalio/temporal
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (95 loc) · 3.43 KB
/
docker-build-manual.yml
File metadata and controls
103 lines (95 loc) · 3.43 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
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
92
93
94
95
96
97
98
99
100
101
102
103
name: Manual Docker Build
# Dispatch this workflow from the branch you want to build from.
on:
workflow_dispatch:
inputs:
alpine-tag:
description: "Alpine base image tag (e.g., 3.23.3)"
required: true
default: "3.23.3"
push:
description: "Push images to Docker Hub"
required: true
type: boolean
default: false
tag-latest:
description: "Tag images as latest"
required: true
type: boolean
default: false
platform:
description: "Platform to build (leave empty for multi-arch, or specify linux/amd64 or linux/arm64)"
required: false
default: ""
snapshot:
description: "Build in snapshot mode (for non-release builds)"
required: true
type: boolean
default: true
permissions:
contents: read
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Determine single-arch parameter
id: arch-param
run: |
if [ -n "${{ inputs.platform }}" ]; then
# Extract arch from platform (e.g., linux/amd64 -> amd64)
ARCH=$(echo "${{ inputs.platform }}" | cut -d'/' -f2)
echo "single-arch=${ARCH}" >> "$GITHUB_OUTPUT"
else
echo "single-arch=" >> "$GITHUB_OUTPUT"
fi
- name: Build binaries
uses: ./.github/actions/build-binaries
with:
snapshot: ${{ inputs.snapshot }}
single-arch: ${{ steps.arch-param.outputs.single-arch }}
- name: Build Docker images
id: build-docker
if: ${{ !inputs.push }}
uses: ./.github/actions/build-docker-images
with:
push: false
tag-latest: ${{ inputs.tag-latest }}
platform: ${{ inputs.platform }}
alpine-tag: ${{ inputs.alpine-tag }}
load: ${{ inputs.platform == 'linux/amd64' || inputs.platform == '' }}
- name: Build and push Docker images
id: push-docker
if: ${{ inputs.push }}
uses: ./.github/actions/build-docker-images
with:
push: true
tag-latest: ${{ inputs.tag-latest }}
platform: ${{ inputs.platform }}
alpine-tag: ${{ inputs.alpine-tag }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Output image tags
env:
SHA_TAG: ${{ steps.build-docker.outputs.sha-tag || steps.push-docker.outputs.sha-tag }}
BRANCH_TAG: ${{ steps.build-docker.outputs.branch-tag || steps.push-docker.outputs.branch-tag }}
run: |
{
echo "### Docker Images Built"
echo ""
echo "**Branch:** ${{ github.ref_name }}"
echo "**SHA Tag:** ${SHA_TAG}"
echo "**Branch Tag:** ${BRANCH_TAG}"
echo "**Platform:** ${{ inputs.platform || 'linux/amd64,linux/arm64' }}"
echo "**Pushed to Docker Hub:** ${{ inputs.push }}"
echo "**Tagged as latest:** ${{ inputs.tag-latest }}"
echo ""
echo "**Image Tags:**"
echo "- temporaliotest/server:${SHA_TAG}"
echo "- temporaliotest/admin-tools:${SHA_TAG}"
echo "- temporaliotest/server:${BRANCH_TAG}"
echo "- temporaliotest/admin-tools:${BRANCH_TAG}"
} >> "$GITHUB_STEP_SUMMARY"