-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 1.42 KB
/
deploy_pages.yaml
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
57
58
name: Deploy to GitHub Pages
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
env:
NODE_VERSION: '18'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: './www/package-lock.json'
- name: Install dependencies
run: |
cd www
npm ci
- name: Build project
run: |
cd www
npm run build
env:
VITE_MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./www/dist
commit_message: ${{ github.event.head_commit.message }}
force_orphan: true
deploy:
needs: build-and-deploy
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4