Skip to content

Update using-msw-with-storybook-jest-dev.md #106

Update using-msw-with-storybook-jest-dev.md

Update using-msw-with-storybook-jest-dev.md #106

name: deploy-workflow
on: [push]
jobs:
deploy-job:
runs-on: ubuntu-latest
steps:
- name: Checks out repo
uses: actions/checkout@v2
- name: Setup Node
id: setup-node
uses: actions/setup-node@v2
with:
node-version: '12'
# cache: 'npm' # https://github.com/actions/setup-node#caching-packages-dependencies
- name: Cache packages and source files # https://nextjs.org/docs/messages/no-cache#github-actions
id: cache
uses: actions/cache@v2
with:
path: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- run: npm install
- run: npm run build
# - name: Commit updated build files
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: Automated publish
- name: Publish to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: Automated publish