-
Notifications
You must be signed in to change notification settings - Fork 26
48 lines (46 loc) · 1.52 KB
/
test-preview.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
# Deploy preview url for labelled PRs
# Specifies deployment target based on pr target branch
# Master -> debug
# Deployment/{deployment_name} -> {deployment_name}
name: Deployment Preview
on:
pull_request:
types: [labeled, synchronize]
branches:
- deployment/*
- master
concurrency:
group: deployment-preview-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'Test - preview')
uses: ./.github/workflows/web-build.yml
secrets: inherit
with:
build-flags: --configuration "production,preview"
# use branch name from PR target as default
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
deployment: ${{ github.base_ref }}
deploy_preview:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: www
- name: Extract Build folder
run: |
mkdir www
tar -xf artifact.tar --directory www
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_PLH_TEENS_APP1 }}"
projectId: plh-teens-app1
target: "${{needs.build.outputs.DEPLOYMENT_NAME}}"
expires: 14d
env:
FIREBASE_CLI_PREVIEWS: hostingchannels