Merge pull request #335 from strudel-science/all-contributors/add-ruc… #162
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: Deploy to GitHub Pages | |
| on: | |
| # Runs on pushes to the main branch | |
| push: | |
| branches: ['main'] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: 'pages' | |
| cancel-in-progress: false | |
| # Default to bash | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install docs dependencies | |
| run: | | |
| cd docs | |
| npm install | |
| - name: Install component dependencies | |
| run: | | |
| cd packages/react-components | |
| npm install | |
| - name: Build docs | |
| run: | | |
| cd docs | |
| npm run build | |
| - name: Build storybook docs | |
| run: | | |
| cd packages/react-components | |
| npm run build-storybook | |
| - name: Deploy docs | |
| run: | | |
| git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
| cd docs | |
| npx gh-pages -d build -e docs -u "github-actions-bot <support+actions@github.com>" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Deploy storybook docs | |
| run: | | |
| git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
| cd packages/react-components | |
| npx gh-pages -d storybook-static -e storybook -u "github-actions-bot <support+actions@github.com>" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # This is necessary to fix a bug in GitHub Pages | |
| # See https://github.com/storybookjs/storybook/issues/20564 | |
| - name: Ensure .nojekyll at gh-pages root | |
| run: | | |
| git config user.name "github-actions-bot" | |
| git config user.email "support+actions@github.com" | |
| git fetch origin gh-pages || true | |
| git checkout gh-pages || git checkout --orphan gh-pages | |
| touch .nojekyll | |
| git add .nojekyll | |
| git commit -m "Add .nojekyll" || true | |
| git push origin gh-pages |