Skip to content

chore: fix permissions for pull-request-closed workflow (#22782) #68

chore: fix permissions for pull-request-closed workflow (#22782)

chore: fix permissions for pull-request-closed workflow (#22782) #68

name: Deploy v12 storybooks to GH pages
on:
workflow_dispatch:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest-larger-disk
strategy:
fail-fast: false
matrix:
include:
- package: react
name: React
destination: v12-react-storybook
cname: v2-react.carbondesignsystem.com
- package: web-components
name: Web Components
destination: v12-web-components-storybook
cname: v3-web-components.carbondesignsystem.com
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js version from .nvmrc
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: yarn install --immutable
- name: Build project
run: yarn build
- name: Build static ${{ matrix.name }} v12 storybook
run: |
cd packages/${{ matrix.package }}
yarn storybook:v12:build
- name: Prepare static output
run: |
touch packages/${{ matrix.package }}/storybook-static-v12/.nojekyll
echo "${{ matrix.cname }}" > packages/${{ matrix.package }}/storybook-static-v12/CNAME
- name: Push ${{ matrix.name }} v12 storybook
uses: cpina/github-action-push-to-another-repository@55306faa4ed53b815ae49e564af8cfb359d32ae2 # v1.7.3
env:
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
source-directory:
'packages/${{ matrix.package }}/storybook-static-v12'
destination-github-username: 'carbon-design-system'
destination-repository-name: ${{ matrix.destination }}
user-name: carbon-bot
user-email: carbon@us.ibm.com
target-branch: main
commit-message: 'chore(website): update v12 storybook'