-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (45 loc) Β· 1.26 KB
/
deploy-to-gh-pages.yml
File metadata and controls
56 lines (45 loc) Β· 1.26 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Deploy to GitHub Pages
on:
pull_request_target:
push:
branches:
- main
jobs:
ci:
runs-on: ${{ matrix.os }}
env:
BASE_PATH: /next-starter
strategy:
matrix:
os: [ubuntu-latest]
node: [16]
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.3.3
if: "github.ref != 'refs/heads/main'"
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- name: Checkout π
uses: actions/checkout@master
- name: Setup node env π
uses: actions/setup-node@v2.5.1
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Next cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies π¨π»βπ»
run: npm ci
- name: Build βοΈ
run: npm run build
- name: Export π
run: npm run export
- name: Deploy π
uses: JamesIves/github-pages-deploy-action@v4.4.0
if: github.ref == 'refs/heads/main'
with:
branch: gh-pages
folder: out
token: ${{ secrets.GH_PAGES_DEPLOY_TOKEN }}