-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (44 loc) · 1.27 KB
/
build_and_deploy.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
name: build-and-deploy
run-name: build and deploy Mapstery
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/hydrogen
- name: "Install Dependencies"
run: npm ci
- name: "Run Tests"
run: npm test
env:
VITE_GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
VITE_GEONAMES_USERNAME: ${{ secrets.GEONAMES_USERNAME }}
- name: "Create Production Build"
run: npm run build
env:
VITE_GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
VITE_GEONAMES_USERNAME: ${{ secrets.GEONAMES_USERNAME }}
VITE_GEONAMES_TOKEN: ${{ secrets.GEONAMES_TOKEN }}
VITE_POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
- uses: actions/upload-artifact@v4
with:
name: mapstery-production-build
path: ./dist
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: mapstery-production-build
path: ./dist
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_PAGES_DEPLOYMENT }}
publish_dir: ./dist