-
Notifications
You must be signed in to change notification settings - Fork 61
77 lines (73 loc) · 2.35 KB
/
build-docker.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: "Build Docker Image"
run-name: "Version: ${{ inputs.imageTag }} --> Latest: ${{ inputs.isLatest }}"
on:
workflow_call:
inputs:
imageTag:
description: Release version
type: string
required: true
isLatest:
description: Is this the latest version?
type: boolean
required: true
workflow_dispatch:
inputs:
imageTag:
description: Release version
type: string
required: true
isLatest:
description: Is this the latest version?
type: boolean
required: true
default: false
jobs:
docker-build:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
steps:
- name: Github Checkout
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up QEMU
# v3.0.0
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3
- name: Set up Docker Buildx
# v3.2.0
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20
- name: Log in to Docker Hub
# v3.1.0
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image with latest tag
# v5.3.0
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
target: production
push: true
build-args: |
LANGTRACE_VERSION=${{ inputs.imageTag }}
tags: |
${{ env.DOCKER_REGISTRY }}:${{ inputs.imageTag }}
${{ env.DOCKER_REGISTRY }}:latest
labels: ${{ inputs.imageTag }}
if: ${{ inputs.isLatest }}
- name: Build and push Docker image without latest tag
# v5.3.0
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
target: production
push: true
tags: ${{ env.DOCKER_REGISTRY }}:${{ inputs.imageTag }}
labels: ${{ inputs.imageTag }}
if: ${{ !inputs.isLatest }}