-
Notifications
You must be signed in to change notification settings - Fork 2.2k
58 lines (47 loc) · 1.55 KB
/
website.yml
File metadata and controls
58 lines (47 loc) · 1.55 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
56
57
58
name: website
on:
push:
branches:
- '*-release'
jobs:
check_branch:
runs-on: ubuntu-latest
outputs:
should_deploy: ${{ endsWith(github.ref, steps.get_version.outputs.latest) }}
steps:
- name: Get version
id: get_version
run: |
LATEST=$(npm show deck.gl@latest version | grep -o -E "^[0-9]+\.[0-9]+")
echo "latest=${LATEST}-release" >> "$GITHUB_OUTPUT"
deploy:
runs-on: ubuntu-latest
needs: check_branch
permissions:
contents: write
if: ${{ github.repository_owner == 'visgl' && needs.check_branch.outputs.should_deploy }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: '18.x'
- name: Install dependencies
run: |
yarn bootstrap
(cd website && yarn)
- name: Build website
env:
MapboxAccessToken: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
GoogleMapsAPIKey: ${{ secrets.GOOGLE_MAPS_API_KEY }}
GoogleMapsMapId: ${{ secrets.GOOGLE_MAPS_MAP_ID }}
run: (cd website && yarn build)
- name: Deploy
uses: JamesIves/github-pages-deploy-action@15de0f09300eea763baee31dff6c6184995c5f6a # 4.7.2
with:
token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
branch: gh-pages
folder: website/build
clean: true