-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (41 loc) · 1.59 KB
/
deploy-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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