-
Notifications
You must be signed in to change notification settings - Fork 2.1k
59 lines (47 loc) · 1.61 KB
/
website.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: website
on:
push:
branches:
- '*-release'
permissions:
contents: read
jobs:
publish-website:
runs-on: ubuntu-latest
if: github.repository_owner == 'visgl'
permissions:
contents: write
env:
MapboxAccessToken: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
GoogleMapsAPIKey: ${{ secrets.GOOGLE_MAPS_API_KEY }}
GoogleMapsMapId: ${{ secrets.GOOGLE_MAPS_MAP_ID }}
steps:
- uses: actions/checkout@86f86b36ef15e6570752e7175f451a512eac206b # v2.1.1
with:
token: ${{ secrets.ADMIN_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1.4.6
with:
node-version: '16.x'
- name: Get version
id: get-version
run: LATEST=$(npm show deck.gl version | grep -o -E "^[0-9]+\.[0-9]+") && echo "::set-output name=latest::/${LATEST}-release"
- name: Check version
if: ${{ !endsWith(github.ref, steps.get-version.outputs.latest) }}
run: |
echo "Website is only published from the latest release branch"
- name: Build website
if: ${{ endsWith(github.ref, steps.get-version.outputs.latest) }}
run: |
yarn bootstrap
cd website
yarn
yarn build
- name: Deploy
if: ${{ endsWith(github.ref, steps.get-version.outputs.latest) }}
uses: JamesIves/github-pages-deploy-action@132898c54c57c7cc6b80eb3a89968de8fc283505 # 3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: website/build
CLEAN: true