generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (62 loc) · 1.98 KB
/
docker_build.yml
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
name: Build & push docker image and deploy to environment
on:
workflow_call:
inputs:
docker_registry:
description: Docker registry
required: true
type: string
registry_org:
description: Docker registry organisation
required: true
type: string
additional_docker_tag:
description: Additional docker tag that can be used to specify stable tags
required: false
type: string
push:
description: Push docker image to registry flag
required: true
type: boolean
docker_multiplatform:
description: Docker image build multiplatform or not
required: true
type: boolean
secrets:
HMPPS_QUAYIO_USER:
required: false
HMPPS_QUAYIO_TOKEN:
required: false
SENTRY_AUTH_TOKEN:
required: true
outputs:
app_version:
description: The version of the app as generated by create_app_version
value: ${{ jobs.docker_build.outputs.version }}
permissions:
contents: read
packages: write
jobs:
docker_build:
name: Build docker image
runs-on: ubuntu-latest
outputs:
version: ${{ steps.app_version.outputs.version }}
steps:
- uses: actions/checkout@v4
- id: app_version
name: Application version creators
uses: ./.github/actions/create_app_version # WORKFLOW_VERSION
- uses: docker/login-action@v3
with:
registry: ${{ inputs.docker_registry }}
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: ./.github/actions/build_multiplatform_docker # WORKFLOW_VERSION
with:
repository_name: ${{ github.event.repository.name }}
docker_registry: ${{ inputs.docker_registry }}
registry_org: ${{ inputs.registry_org }}
additional_docker_tag: ${{ secrets.SENTRY_AUTH_TOKEN }}
push: ${{ inputs.push }}
app_version: ${{ steps.app_version.outputs.version }}