Merge pull request #513 from bcgov/feature/react-components-v0.5.0 #93
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |