-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (55 loc) · 1.99 KB
/
firebase-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
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
name: Deploy to Firebase Hosting
on:
push:
branches:
- main
jobs:
Staging:
runs-on: ubuntu-latest
environment:
name: Staging
url : "https://pensdown-staging.web.app"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '19'
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Set Environment Variables Base API
run: echo "VITE_BASE_API=${{ secrets.VITE_BASE_API }}" >> $GITHUB_ENV
- name: Set Environment Variables Staging
run: echo "FIREBASE_PROJECT_ID=${{ secrets.STAGING }}" >> $GITHUB_ENV
- name: Install Dependencies
run: npm install --force
- name: Build Vite Project
run: npm run build
- name: Deploy to Firebase (Staging)
run: firebase deploy --token ${{ secrets.FIREBASE_TOKEN }} --only hosting --project ${{ env.FIREBASE_PROJECT_ID }}
Production:
needs: [Staging]
runs-on: ubuntu-latest
environment:
name: Production
url : "https://pensdown-dad2d.firebaseapp.com/"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '19'
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Set Environment Variables for Production
run: echo "VITE_BASE_API=${{ secrets.VITE_BASE_API }}" >> $GITHUB_ENV
- name: Set Environment Variables for Production
run: echo "FIREBASE_PROJECT_ID=${{ secrets.PRODUCTION }}" >> $GITHUB_ENV
- name: Install Dependencies
run: npm install --force
- name: Build Vite Project
run: npm run build
- name: Deploy to Firebase (Production)
run: firebase deploy --token ${{ secrets.FIREBASE_TOKEN }} --only hosting --project ${{ env.FIREBASE_PROJECT_ID }}