-
Notifications
You must be signed in to change notification settings - Fork 40
76 lines (62 loc) · 3.16 KB
/
build_react_component_library_apps.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
name: Build and push React component library app images
on:
push:
paths:
- packages/react-components/**
branches: [main]
workflow_dispatch:
# Cancel any currently running builds to save GitHub Actions hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
storybook-build-and-push:
name: Storybook build and push
runs-on: ubuntu-latest
if: github.repository == 'bcgov/design-system'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build image with docker build
run: docker build ./packages/react-components/ -f ./packages/react-components/Dockerfile.storybook -t design-system-react-components-storybook:latest --build-arg GITHUB_SHA=${{ github.sha }}
- name: Login to OpenShift Silver image registry
uses: docker/login-action@v3
with:
registry: image-registry.apps.silver.devops.gov.bc.ca
# This refers to the serviceaccount name alone, not the fully qualified
# value that comes out of `oc whoami` when logged in as the SA.
# Ex: For `system:serviceaccount:<name space>:<service account name>`,
# just use `<service account name>`.
username: ${{ secrets.OPENSHIFT_SILVER_SERVICEACCOUNT_USERNAME }}
password: ${{ secrets.OPENSHIFT_SILVER_SERVICEACCOUNT_TOKEN }}
- name: Tag and push Docker image
run: |
docker tag design-system-react-components-storybook:latest image-registry.apps.silver.devops.gov.bc.ca/${{ secrets.OPENSHIFT_SILVER_LICENSE_PLATE }}-tools/design-system-react-components-storybook:develop
docker push image-registry.apps.silver.devops.gov.bc.ca/${{ secrets.OPENSHIFT_SILVER_LICENSE_PLATE }}-tools/design-system-react-components-storybook --all-tags
vite-build-and-push:
name: Vite build and push
runs-on: ubuntu-latest
if: github.repository == 'bcgov/design-system'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build image with docker build
run: docker build ./packages/react-components/ -f ./packages/react-components/Dockerfile.vite -t design-system-react-components-vite:latest
- name: Login to OpenShift Silver image registry
uses: docker/login-action@v3
with:
registry: image-registry.apps.silver.devops.gov.bc.ca
username: ${{ secrets.OPENSHIFT_SILVER_SERVICEACCOUNT_USERNAME }}
password: ${{ secrets.OPENSHIFT_SILVER_SERVICEACCOUNT_TOKEN }}
- name: Tag and push Docker image
run: |
docker tag design-system-react-components-vite:latest image-registry.apps.silver.devops.gov.bc.ca/${{ secrets.OPENSHIFT_SILVER_LICENSE_PLATE }}-tools/design-system-react-components-vite:develop
docker push image-registry.apps.silver.devops.gov.bc.ca/${{ secrets.OPENSHIFT_SILVER_LICENSE_PLATE }}-tools/design-system-react-components-vite --all-tags