-
Notifications
You must be signed in to change notification settings - Fork 44
35 lines (35 loc) · 930 Bytes
/
publish.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
name: Gatsby Publish
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
env:
TZ: America/Los_Angeles
GATSBY_BUILD_ENV: production
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install --force
- name: Build
run: yarn run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public