-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (43 loc) · 1.55 KB
/
deploy.yml
File metadata and controls
51 lines (43 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
name: deploy website
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
env:
SENTRY_ENVIRONMENT: production
VITE_GOOGLE_ANALYTICS_API_KEY: ${{ secrets.VITE_GOOGLE_ANALYTICS_API_KEY }}
VITE_APP_MAP_API_KEY: ${{ secrets.VITE_APP_MAP_API_KEY }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: Use Node.js 24.x
uses: actions/setup-node@v3
with:
node-version: 24.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: Debug environment variables
run: printenv | sort | grep VITE
- name: Build & deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REACT_APP_NAME: ${{ env.VERSION }}
SENTRY_ENVIRONMENT: ${{ env.SENTRY_ENVIRONMENT}}
REACT_APP_VERSION: ${{ env.VERSION }}
VITE_GOOGLE_ANALYTICS_API_KEY: ${{ env.VITE_GOOGLE_ANALYTICS_API_KEY }}
VITE_APP_MAP_API_KEY: ${{ env.VITE_APP_MAP_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>"