-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (103 loc) · 4.52 KB
/
publish-hcw-docker-images.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Publish HCW Docker images with i18n translations
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
HCW_ADMIN_IMAGE_NAME: hcw-admin
HCW_ADMIN_CONTEXT: ./admin
HCW_DOCTOR_IMAGE_NAME: hcw-doctor
HCW_DOCTOR_CONTEXT: ./doctor
HCW_PATIENT_IMAGE_NAME: hcw-patient
HCW_PATIENT_CONTEXT: ./patient
HCW_BACKEND_IMAGE_NAME: hcw-backend
HCW_BACKEND_CONTEXT: ./backend
IMAGE_TAG: latest
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Load .env file
id: dotenv
uses: falti/[email protected]
- name: Extract metadata (tags, labels) for Docker Admin v${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }}
id: meta-admin
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.HCW_ADMIN_IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }}-${{ env.IMAGE_TAG }}
type=sha,prefix=${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }}-
- name: Extract metadata (tags, labels) for Docker Doctor v${{ steps.dotenv.outputs.HCW_DOCTOR_VERSION }}
id: meta-doctor
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.HCW_DOCTOR_IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.dotenv.outputs.HCW_DOCTOR_VERSION }}-${{ env.IMAGE_TAG }}
type=sha,prefix=${{ steps.dotenv.outputs.HCW_DOCTOR_VERSION }}-
- name: Extract metadata (tags, labels) for Docker Patient v${{ steps.dotenv.outputs.HCW_PATIENT_VERSION }}
id: meta-patient
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.HCW_PATIENT_IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.dotenv.outputs.HCW_PATIENT_VERSION }}-${{ env.IMAGE_TAG }}
type=sha,prefix=${{ steps.dotenv.outputs.HCW_PATIENT_VERSION }}-
- name: Extract metadata (tags, labels) for Docker Backend v${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }}
id: meta-backend
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.HCW_BACKEND_IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }}-${{ env.IMAGE_TAG }}
type=sha,prefix=${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }}-
- name: Build and push HCW Admin v${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }} i18n Docker image
uses: docker/build-push-action@v5
with:
context: ${{ env.HCW_ADMIN_CONTEXT }}
build-args: |
HCW_ADMIN_VERSION=${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }}
push: true
tags: ${{ steps.meta-admin.outputs.tags }}
labels: ${{ steps.meta-admin.outputs.labels }}
- name: Build and push HCW Doctor v${{ steps.dotenv.outputs.HCW_DOCTOR_VERSION }} i18n Docker image
uses: docker/build-push-action@v5
with:
context: ${{ env.HCW_DOCTOR_CONTEXT }}
build-args: |
HCW_DOCTOR_VERSION=${{ steps.dotenv.outputs.HCW_DOCTOR_VERSION }}
push: true
tags: ${{ steps.meta-doctor.outputs.tags }}
labels: ${{ steps.meta-doctor.outputs.labels }}
- name: Build and push HCW PATIENT v$${{ steps.dotenv.outputs.HCW_PATIENT_VERSION }} i18n Docker image
uses: docker/build-push-action@v5
with:
context: ${{ env.HCW_PATIENT_CONTEXT }}
build-args: |
HCW_PATIENT_VERSION=${{ steps.dotenv.outputs.HCW_PATIENT_VERSION }}
push: true
tags: ${{ steps.meta-patient.outputs.tags }}
labels: ${{ steps.meta-patient.outputs.labels }}
- name: Build and push HCW BACKEND v${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }} i18n Docker image
uses: docker/build-push-action@v5
with:
context: ${{ env.HCW_BACKEND_CONTEXT }}
build-args: |
HCW_BACKEND_VERSION=${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }}
push: true
tags: ${{ steps.meta-backend.outputs.tags }}
labels: ${{ steps.meta-backend.outputs.labels }}