Merge pull request #787 from adobe/clipFix #29
This file contains hidden or 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: Publish S2 Storybook and Docs to GitHub Pages | |
| # This action runs when a branch has been merged to main. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: gh-pages-deploy | |
| cancel-in-progress: false | |
| permissions: | |
| pages: write | |
| id-token: write | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| - name: Install Dependencies 📦 | |
| run: yarn install | |
| - name: Build S2 Packages | |
| run: yarn build:s2 | |
| - name: Build S2 Storybook | |
| run: yarn build:storybook:s2 | |
| - name: Build S2 Docs | |
| run: yarn build:docs:s2 | |
| - name: Checkout 'gh-pages' branch and update s2/ subdirectory | |
| run: | | |
| git config user.name "marshallpete" | |
| git config user.email "40001449+marshallpete@users.noreply.github.com" | |
| # Fetch the existing gh-pages branch | |
| git fetch origin gh-pages | |
| # Checkout the existing gh-pages branch | |
| git checkout gh-pages | |
| # Remove only the s2/ subdirectory so S1 content is untouched | |
| rm -rf s2/ | |
| - name: Copy 'dist-storybook-s2' to 's2/' on 'gh-pages' branch | |
| run: | | |
| mkdir -p s2 | |
| cp -r dist-storybook-s2/* s2/ | |
| - name: Copy S2 docs to 's2/docs/' on 'gh-pages' branch | |
| run: | | |
| mkdir -p s2/docs | |
| cp -r packages/docs-s2/dist/* s2/docs/ | |
| - name: Commit and push changes to 'gh-pages' branch | |
| run: | | |
| git add -- s2/ | |
| git commit -m "Update gh-pages with latest S2 Storybook and Docs build" | |
| git push origin gh-pages |