-
Notifications
You must be signed in to change notification settings - Fork 5
108 lines (89 loc) · 3.1 KB
/
dev-build-frontend.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
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
name: Build Frontend - Dev
on:
push:
branches: [develop]
paths:
- "workspace/**"
workflow_dispatch:
# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-frontend-silver:
name: Frontend Build - Silver
runs-on: ubuntu-latest
defaults:
run:
working-directory: "./workspace"
steps:
- name: "Checkout Code"
uses: actions/checkout@master
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: YARN Install
run: |
yarn install
- name: YARN Build
run: |
yarn build
- name: "Docker Build"
run: |
docker build -t image-registry.apps.silver.devops.gov.bc.ca/d8a8f9-tools/pidp-frontend:develop .
# Uses the builder service account token
- name: "Docker Login to Silver OCP"
uses: docker/login-action@v2
with:
registry: image-registry.apps.silver.devops.gov.bc.ca
username: builder
password: ${{ secrets.SILVER_TOOLS_BUILDER_TOKEN }}
- name: "Push image"
run: |
docker push image-registry.apps.silver.devops.gov.bc.ca/d8a8f9-tools/pidp-frontend:develop
build-frontend-gold:
name: Frontend Build - Gold
runs-on: ubuntu-latest
defaults:
run:
working-directory: "./workspace"
steps:
- name: "Checkout Code"
uses: actions/checkout@master
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: YARN Install
run: |
yarn install
- name: YARN Build
run: |
yarn build
- name: "Docker Build GOLD"
run: |
docker build -t image-registry.apps.gold.devops.gov.bc.ca/f088b1-tools/pidp-frontend:develop .
# Uses the Artifactory service account's username and password
- name: "Docker Login to GOLD OCP"
uses: docker/login-action@v2
with:
registry: image-registry.apps.gold.devops.gov.bc.ca
username: builder
password: ${{ secrets.GOLD_TOOLS_BUILDER_TOKEN }}
- name: "Push image to GOLD OCP"
run: |
docker push image-registry.apps.gold.devops.gov.bc.ca/f088b1-tools/pidp-frontend:develop
- name: "Docker Build GOLDDR"
run: |
docker tag image-registry.apps.gold.devops.gov.bc.ca/f088b1-tools/pidp-frontend:develop image-registry.apps.golddr.devops.gov.bc.ca/f088b1-tools/pidp-frontend:develop
# Uses the Artifactory service account's username and password
- name: "Docker Login to GOLDDR OCP"
uses: docker/login-action@v2
with:
registry: image-registry.apps.golddr.devops.gov.bc.ca
username: builder
password: ${{ secrets.GOLDDR_TOOLS_BUILDER_TOKEN }}
- name: "Push image to GOLDDR OCP"
run: |
docker push image-registry.apps.golddr.devops.gov.bc.ca/f088b1-tools/pidp-frontend:develop