-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.09 KB
/
deploy.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
on:
push:
branches:
- main
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Create dot env file
shell: bash
env:
NEXT_PUBLIC_API_TOKEN: ${{ secrets.NEXT_PUBLIC_API_TOKEN}}
run: |
touch .env
echo "NEXT_PUBLIC_API_TOKEN = $NEXT_PUBLIC_API_TOKEN" >> .env
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Export to Static Pages
run: npm run export
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'