-
Notifications
You must be signed in to change notification settings - Fork 8
54 lines (53 loc) · 1.82 KB
/
firebase-hosting-pull-request.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
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Pull request build and deploy
'on': pull_request
jobs:
build:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.18.0
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
if: steps.cache-npm.outputs.cache-hit != 'true'
run: yarn --immutable
- run: yarn test
- run: yarn build
env:
REACT_APP_VERSION: ${{ github.sha }}
REACT_APP_ENTUR_CLIENT_NAME: entur-shamash2023
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: |
build
preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ENT_SHAMASH_DEV }}'
projectId: ent-shamash-dev