-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.26 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
42
name: 'Deploy to Github Pages'
# Trigger on pushes to the master branch
on:
push:
branches:
- 'main'
jobs:
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Prettier check'
# Use commit hash version that is updated to Node 16 (update to a release version when available)
uses: actionsx/prettier@e90ec5455552f0f640781bdd5f5d2415acb52f1a
with:
args: --check .
deploy:
name: Deploy to Github Pages
runs-on: ubuntu-latest
needs: prettier
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Setup node (with caching node_modules)'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: 'Install Dependencies'
run: npm ci --ignore-scripts
- name: 'Github Pages Deployment'
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npm run deploy -- -u "github-actions-bot <support+actions@github.com>"
# Only deploy the main branch (precaution)
if: ${{ github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}