-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (37 loc) · 1.28 KB
/
deploy.yml
File metadata and controls
43 lines (37 loc) · 1.28 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
name: deploy website
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build & deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REACT_APP_NAME: ${{ secrets.REACT_APP_VERSION }}
SENTRY_ENVIRONMENT: ${{ secrets.SENTRY_ENVIRONMENT}}
REACT_APP_VERSION: ${{ secrets.REACT_APP_VERSION }}
REACT_APP_MAP_API_KEY: ${{ secrets.REACT_APP_MAP_API_KEY }}
REACT_APP_GOOGLE_ANALYTICS_API_KEY: ${{ secrets.REACT_APP_GOOGLE_ANALYTICS_API_KEY}}
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npm i
npm run build
npx gh-pages --branch gh-pages --dist build -u "github-actions-bot <support+actions@github.com>"