-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (74 loc) · 2.37 KB
/
deploy-dev.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
name: Development - Deploy to Firebase Hosting
# This workflow deploys the static-generated nextjs app to Firebase Hosting
# Triggered by push to the "dev" branch
on:
push:
branches:
- dev
- feat/weaponsforge-143
env:
FIREBASE_TARGET: 'dev'
jobs:
lint-export-client:
name: Lint and Export client
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_BASE_PATH: ''
NEXT_PUBLIC_FIREBASE_WEB_API_KEY: ${{ secrets.FIREBASE_WEB_API_KEY_DEV }}
NEXT_PUBLIC_FIREBASE_WEB_AUTHDOMAIN: ${{ secrets.FIREBASE_WEB_AUTHDOMAIN_DEV }}
NEXT_PUBLIC_FIREBASE_WEB_PROJECT_ID: ${{ secrets.FIREBASE_WEB_PROJECT_ID_DEV }}
NEXT_PUBLIC_FIREBASE_WEB_STORAGE_BUCKET: ${{ secrets.FIREBASE_WEB_STORAGE_BUCKET_DEV }}
FIREBASE_HOSTING_DEV: ${{ secrets.FIREBASE_HOSTING_DEV }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
ref: 'feat/weaponsforge-143'
# ref: $FIREBASE_TARGET
- name: Build Firebase Settings
run: chmod u+x scripts/build.sh && ./scripts/build.sh
- name: Use NodeJS v16.14.2
uses: actions/setup-node@v3
with:
node-version: 16.14.2
- name: Install Dependencies and lint
run: |
cd client
npm install
- name: Lint
run: |
cd client
npm run lint
- name: Export static files
run: |
cd client
npm run export
- name: Archive Development Artifact
uses: actions/upload-artifact@v4
with:
name: dev-app
include-hidden-files: true
path: |
client/out
client/firebase.json
client/.firebaserc
retention-days: 3
# Deploy Firebase: Hosting, Firestore/Storage Rules and Indexes
deploy-firebase:
name: Deploy Client to Firebase Hosting
needs: lint-export-client
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: dev-app
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: >
use $FIREBASE_TARGET &&
echo "active project: $FIREBASE_TARGET" &&
deploy --only firestore:rules,firestore:indexes,storage,hosting:$FIREBASE_TARGET
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}