Skip to content

Merge pull request #379 from bcgov/chore/bump-react-component-deps #16

Merge pull request #379 from bcgov/chore/bump-react-component-deps

Merge pull request #379 from bcgov/chore/bump-react-component-deps #16

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" }}

Check failure on line 19 in .github/workflows/build_react_component_library_apps.yaml

View workflow run for this annotation

GitHub Actions / Build and push React component library app images

Invalid workflow file

The workflow is not valid. .github/workflows/build_react_component_library_apps.yaml (Line: 19, Col: 9): Unexpected symbol: '"bcgov/design-system"'. Located at position 22 within expression: github.repository == "bcgov/design-system" .github/workflows/build_react_component_library_apps.yaml (Line: 52, Col: 9): Unexpected symbol: '"bcgov/design-system"'. Located at position 22 within expression: 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