Skip to content

Merge pull request #829 from bcgov/dependabot/npm_and_yarn/packages/r… #233

Merge pull request #829 from bcgov/dependabot/npm_and_yarn/packages/r…

Merge pull request #829 from bcgov/dependabot/npm_and_yarn/packages/r… #233

name: Build and push React component library app images
permissions:
contents: read
on:
push:
paths:
- packages/react-components/**
branches: [main]
release:
types: [published]
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-dev:
name: Storybook build and push to dev environment
runs-on: ubuntu-latest
if: github.repository == 'bcgov/design-system'
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
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@371161bbe7024a29a25c5e19bfcbc0804fe9ad2c # v4.5.2
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
storybook-build-and-push-prod:
name: Storybook build and push to production
if: ${{ github.event_name == 'release' && contains(github.event.release.tag_name, 'bcgov/design-system-react-components') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
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@371161bbe7024a29a25c5e19bfcbc0804fe9ad2c # v4.5.2
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:production
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
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@371161bbe7024a29a25c5e19bfcbc0804fe9ad2c # v4.5.2
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