generated from dscnitrourkela/template
-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (40 loc) · 1.26 KB
/
prDeploy.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
name: Firebase PR Preview Deploy
on:
pull_request:
types: [labeled]
env:
REACT_APP_CLOUDFLARE_APIKEY: ${{secrets.CLOUDFLARE_APIKEY}}
jobs:
firebase-pr-preview:
name: Firebase Development Deploy
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'create-live-preview')
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Node v14
uses: actions/setup-node@master
with:
node-version: '14.x'
- name: Create .env File
run: |
touch .env
echo REACT_APP_CLOUDFLARE_APIKEY=$REACT_APP_CLOUDFLARE_APIKEY >> .env
cat .env
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build React WebApp
run: yarn build
- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
projectId: apti-che
expires: 14d
- name: removelabel
uses: buildsville/add-remove-label@v1
with:
token: ${{secrets.GITHUB_TOKEN}}
label: create-live-preview
type: remove