-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (90 loc) · 3.29 KB
/
deploy.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Deploy to Firebase Hosting
on:
push:
branches: [ main ]
env:
CI: true
VITE_APP_FIREBASE_PROJECT_ID: ${{ secrets.VITE_APP_FIREBASE_PROJECT_ID }}
VITE_APP_FIREBASE_API_KEY: ${{ secrets.VITE_APP_FIREBASE_API_KEY }}
VITE_APP_FIREBASE_AUTH_DOMAIN: ${{ secrets.VITE_APP_FIREBASE_AUTH_DOMAIN }}
VITE_APP_FIREBASE_DATABASE_URL: ${{ secrets.VITE_APP_FIREBASE_DATABASE_URL }}
VITE_APP_FIREBASE_STORAGE_BUCKET: ${{ secrets.VITE_APP_FIREBASE_STORAGE_BUCKET }}
VITE_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.VITE_APP_FIREBASE_MESSAGING_SENDER_ID }}
VITE_APP_FIREBASE_APP_ID: ${{ secrets.VITE_APP_FIREBASE_APP_ID }}
VITE_APP_GOOGLE_ANALYTICS_ID: ${{ secrets.VITE_APP_GOOGLE_ANALYTICS_ID }}
VITE_APP_RECAPTCHA_SITE_KEY: ${{ secrets.VITE_APP_RECAPTCHA_SITE_KEY }}
VITE_APP_ALGOLIA_API_KEY: ${{ secrets.VITE_APP_ALGOLIA_API_KEY }}
VITE_APP_ALGOLIA_APP_ID: ${{ secrets.VITE_APP_ALGOLIA_APP_ID }}
VITE_APP_ALGOLIA_INDEX_NAME: ${{ secrets.VITE_APP_ALGOLIA_INDEX_NAME }}
VITE_APP_I18N_LOCALE: en
VITE_APP_I18N_FALLBACK_LOCALE: en
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
jobs:
linting:
name: Run Linter
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install Global Dependencies
run: npm install -g pnpm
- name: Install Local Dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: dist
path: dist
deploy:
name: Deploy to https://questlists.web.app
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x] # only use 10, for firebase-tools compatibility
env:
NODE_ENV: production
CI: false
VITE_APP_FIREBASE_DATABASE_URL: ${{ secrets.PROD_VITE_APP_FIREBASE_DATABASE_URL }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
VITE_APP_RECAPTCHA_SITE_KEY: ${{ secrets.VITE_APP_RECAPTCHA_SITE_KEY }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Authenticate with GCP
run: |
echo ${GCP_SA_KEY} > ${HOME}/gcp-sa.json
export GOOGLE_APPLICATION_CREDENTIALS=${HOME}/gcp-sa.json
sudo apt-get install google-cloud-sdk -y
gcloud auth activate-service-account --key-file=${HOME}/gcp-sa.json
- run: pnpm install --production=false
- run: pnpm makeIcons && pnpm build
# - name: Deploy to Firebase
# uses: w9jds/firebase-action@master
# with:
# args: deploy
- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_QUESTLISTS }}'
channelId: live
projectId: questlists