-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (46 loc) · 1.42 KB
/
ci.yml
File metadata and controls
55 lines (46 loc) · 1.42 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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
- name: Cache build
uses: actions/cache@v3
id: cache_build
with:
path: |
'**/node_modules'
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Echo cache build outputs
run: echo '${{ toJSON(steps.cache_build.outputs) }}'
- name: Create .env file
run: |
echo "${{ secrets.ENV }}" > .env
- name: Install deps
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Build
run: yarn build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out