-
-
Notifications
You must be signed in to change notification settings - Fork 3
129 lines (111 loc) · 4.25 KB
/
wizard.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
120
121
122
123
124
125
126
127
128
129
name: Wizard Client CI
on:
push:
pull_request:
jobs:
btp:
name: Build-Tag-Push
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20 ]
env:
COMPONENT: wizard
IMAGE_NAME: wizard-client
PUBLIC_IMAGE_PREFIX: datastewardshipwizard
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_META_CONTEXT: '.'
DOCKER_META_FILE: './engine-wizard/docker/Dockerfile'
DOCKER_META_SUFFIX: ''
DOCKER_META_PLATFORMS: 'linux/amd64,linux/arm64'
steps:
- name: '[setup] Checkout Project'
uses: actions/checkout@v4
- name: '[setup] QEMU'
uses: docker/setup-qemu-action@v3
- name: '[setup] Docker Buildx'
id: buildx
uses: docker/setup-buildx-action@v3
- name: '[setup] Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: '[app] Install'
run: npm ci
- name: '[app] Test'
run: |
npm run test:$COMPONENT
- name: '[app] Build'
run: |
./scripts/build.sh
- name: '[docker] Meta (default)'
id: meta-default
uses: docker/metadata-action@v5
with:
images: |
${{ env.PUBLIC_IMAGE_PREFIX }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
flavor: |
suffix=${{ env.DOCKER_META_SUFFIX }}
- name: '[docker] Build (default)'
uses: docker/build-push-action@v6
with:
context: ${{ env.DOCKER_META_CONTEXT }}
file: ${{ env.DOCKER_META_FILE }}
platforms: ${{ env.DOCKER_META_PLATFORMS }}
push: false
tags: ${{ steps.meta-default.outputs.tags }}
labels: ${{ steps.meta-default.outputs.labels }}
- name: '[docker] Login'
if: github.event_name != 'pull_request' && env.DOCKER_HUB_USERNAME != ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: '[docker-dev] Meta (default)'
id: meta-dev-default
if: github.event_name != 'pull_request' && env.DOCKER_HUB_USERNAME != ''
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
flavor: |
suffix=${{ env.DOCKER_META_SUFFIX }}
- name: '[docker-dev] Build + Push (default)'
uses: docker/build-push-action@v6
if: github.event_name != 'pull_request' && steps.meta-dev-default.outputs.tags != '' && env.DOCKER_HUB_USERNAME != ''
with:
context: ${{ env.DOCKER_META_CONTEXT }}
file: ${{ env.DOCKER_META_FILE }}
platforms: ${{ env.DOCKER_META_PLATFORMS }}
push: true
tags: ${{ steps.meta-dev-default.outputs.tags }}
labels: ${{ steps.meta-dev-default.outputs.labels }}
- name: '[docker-public] Meta (default)'
id: meta-public-default
if: github.event_name != 'pull_request' && env.DOCKER_HUB_USERNAME != ''
uses: docker/metadata-action@v5
with:
images: |
${{ env.PUBLIC_IMAGE_PREFIX }}/${{ env.IMAGE_NAME }}
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
flavor: |
suffix=${{ env.DOCKER_META_SUFFIX }}
- name: '[docker-public] Build + Push (default)'
uses: docker/build-push-action@v6
if: github.event_name != 'pull_request' && steps.meta-public-default.outputs.tags != '' && env.DOCKER_HUB_USERNAME != ''
with:
context: ${{ env.DOCKER_META_CONTEXT }}
file: ${{ env.DOCKER_META_FILE }}
platforms: ${{ env.DOCKER_META_PLATFORMS }}
push: true
tags: ${{ steps.meta-public-default.outputs.tags }}
labels: ${{ steps.meta-public-default.outputs.labels }}