Add codecov token for coverage #4321
This file contains 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 GH Pages | |
on: | |
push: | |
# Don't run for irrelevant changes. | |
paths-ignore: | |
- 'docs/**' | |
- '!.github/workflows/deploy-storybook.yml' | |
- '.storybook/**' | |
- '.wordpress-org/**' | |
- '__mocks__/**' | |
- '__static__/**' | |
- 'bin/**' | |
- 'tests/**' | |
branches: | |
- main | |
permissions: | |
contents: read | |
# Cancels all previous workflow runs for pull requests that have not completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the (target) branch name. | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-storybook: | |
name: Build storybook | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # for Git to git push | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Setup Node | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
env: | |
PUPPETEER_SKIP_DOWNLOAD: true | |
- name: Build storyook | |
run: npm run storybook:build | |
- name: Checkout gh-pages | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
with: | |
ref: gh-pages | |
token: ${{ secrets.GOOGLEFORCREATORS_BOT_TOKEN }} | |
path: gh-pages | |
- name: Move storybook assets | |
run: | | |
rm -rf gh-pages/storybook/* | |
mv build/storybook/* gh-pages/storybook/ | |
- name: Commit updates | |
run: | | |
git add . | |
git status | |
git diff --staged --quiet && echo 'No changes to commit; exiting!' && exit 0 | |
git commit -m "Deploy storybook for ${{ github.sha }}" | |
git pull --rebase --no-edit --quiet | |
git push origin gh-pages | |
env: | |
GIT_AUTHOR_EMAIL: 94923726+googleforcreators-bot@users.noreply.github.com | |
GIT_AUTHOR_NAME: googleforcreators-bot | |
GIT_COMMITTER_EMAIL: 94923726+googleforcreators-bot@users.noreply.github.com | |
GIT_COMMITTER_NAME: googleforcreators-bot | |
working-directory: ./gh-pages |