-
Notifications
You must be signed in to change notification settings - Fork 3
148 lines (117 loc) · 6.02 KB
/
firebase-hosting-merge.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Website Deployed
on:
push:
branches: [ main, stage, develop ]
workflow_dispatch:
jobs:
develop-deployment:
name: 🔊 Deploying to developing site
if: ${{ contains( github.ref , 'develop' ) }}
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out the repository code
uses: actions/checkout@v2
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Create env file
run: |
touch .env
echo SKIP_PREFLIGHT_CHECK=${{ secrets.UTASKS_SKIP_PREFLIGHT_CHECK }} >> .env
echo REACT_APP_TITLE=UTesks-develop >> .env
echo REACT_APP_BUILD_TARGET=${{ secrets.REACT_APP_BUILD_TARGET }} >> .env
echo REACT_APP_NAME=UTesks-develop >> .env
echo REACT_APP_VERSION=${{ secrets.UTASKS_REACT_APP_VERSION }} >> .env
- name: Installing yarn packages
run: yarn
- name: Set the project environment
run: yarn firebase use DEVELOP --token ${{ secrets.FIREBASE_TOKEN }}
- name: Auto generating the firebase configuration
run: yarn firebase apps:sdkconfig web --token ${{ secrets.FIREBASE_TOKEN }} --json | tail -n +3 |head -n -1 > ./src/utasks-configuration.json
- name: Build the app
run: yarn build
- run: echo "🖥️ The workflow is now ready to deploy the ${{ github.repository }} code"
- name: Deploying to the development site
run: yarn firebase deploy --only hosting:utasks-develop --non-interactive --token ${{ secrets.FIREBASE_TOKEN }} -m "RunID ${{ github.run_id }} Commit SHA ${{ github.sha }}"
stage-deployment:
name: 🔊 Deploying to staging site
if: ${{ contains( github.ref , 'stage' ) }}
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out the repository code
uses: actions/checkout@v2
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Create env file
run: |
touch .env
echo SKIP_PREFLIGHT_CHECK=${{ secrets.UTASKS_SKIP_PREFLIGHT_CHECK }} >> .env
echo REACT_APP_TITLE=UTesks-stage >> .env
echo REACT_APP_BUILD_TARGET=${{ secrets.REACT_APP_BUILD_TARGET }} >> .env
echo REACT_APP_NAME=UTesks-stage >> .env
echo REACT_APP_VERSION=${{ secrets.UTASKS_REACT_APP_VERSION }} >> .env
- name: Installing yarn packages
run: yarn
- name: Set the project environment
run: yarn firebase use STAGE --token ${{ secrets.FIREBASE_TOKEN }}
- name: Auto generating the firebase configuration
run: yarn firebase apps:sdkconfig web --token ${{ secrets.FIREBASE_TOKEN }} --json | tail -n +3 |head -n -1 > ./src/utasks-configuration.json
- name: Build the app
run: yarn build
- run: echo "🖥️ The workflow is now ready to deploy the ${{ github.repository }} code"
- name: Deploying to the development site
run: yarn firebase deploy --only hosting:utasks-stage --non-interactive --token ${{ secrets.FIREBASE_TOKEN }} -m "RunID ${{ github.run_id }} Commit SHA ${{ github.sha }}"
production-deployment:
name: 🔊 Deploying to production site
if: ${{ contains( github.ref , 'main' ) }}
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out the repository code
uses: actions/checkout@v2
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Create env file
run: |
touch .env
echo SKIP_PREFLIGHT_CHECK=${{ secrets.UTASKS_SKIP_PREFLIGHT_CHECK }} >> .env
echo REACT_APP_TITLE=UTesks >> .env
echo REACT_APP_BUILD_TARGET=${{ secrets.REACT_APP_BUILD_TARGET }} >> .env
echo REACT_APP_NAME=UTesks >> .env
echo REACT_APP_VERSION=${{ secrets.UTASKS_REACT_APP_VERSION }} >> .env
- name: Installing yarn packages
run: yarn
- name: Set the project environment
run: yarn firebase use MAIN --token ${{ secrets.FIREBASE_TOKEN }}
- name: Auto generating the firebase configuration
run: yarn firebase apps:sdkconfig web --token ${{ secrets.FIREBASE_TOKEN }} --json | tail -n +3 |head -n -1 > ./src/utasks-configuration.json
- name: Build the app
run: yarn build
- run: echo "🖥️ The workflow is now ready to deploy the ${{ github.repository }} code"
- name: Deploying to the development site
run: yarn firebase deploy --only hosting:utasks-main --non-interactive --token ${{ secrets.FIREBASE_TOKEN }} -m "RunID ${{ github.run_id }} Commit SHA ${{ github.sha }}"