-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.09 KB
/
main.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
42
43
44
45
# Simple workflow for deploying static content to GitHub Pages
name: Main
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: ".nvmrc"
- name: Install
run: npm ci --prefer-offline --no-audit
- name: Lint
run: npm run lint
- name: Build
run: npm run build
deploy:
needs: test
if: github.ref_name == 'master'
concurrency: production
runs-on: ubuntu-latest
environment:
name: production
url: ${{ vars.SURGE_DOMAIN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: ".nvmrc"
- name: Install
run: npm install --prefer-offline --no-audit
- name: Build
run: npm run build
- name: Deploy
run: npx surge ./dist ${{ vars.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }}