Refactor: gdrive tools auth #2372
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
# Actions environment to load for secrets and variables | |
# See child web-build action for vars and secrets required | |
FIREBASE_HOSTING_TARGET: ${{vars.FIREBASE_HOSTING_TARGET}} | |
FIREBASE_PROJECT_ID: ${{vars.FIREBASE_PROJECT_ID}} | |
name: Deployment Preview | |
on: | |
pull_request: | |
types: [labeled, synchronize] | |
branches: | |
- master | |
concurrency: | |
group: test-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" | |
deployment-env: debug | |
deploy_preview: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: debug | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: www | |
- name: Extract Build folder | |
run: | | |
mkdir www | |
tar -xf artifact.tar --directory www | |
# HACK - although deployments set their firebase.json from config the file is | |
# not passed back from artifact so hardcode via action | |
- name: Populate firebase config | |
run: | | |
cp firebase.template.json firebase.json | |
sed -i 's/${FIREBASE_HOSTING_TARGET}/${{ env.FIREBASE_HOSTING_TARGET }}/g' firebase.json | |
cp .template.firebaserc .firebaserc | |
sed -i 's/${FIREBASE_HOSTING_TARGET}/${{ env.FIREBASE_HOSTING_TARGET }}/g' .firebaserc | |
sed -i 's/${FIREBASE_PROJECT_ID}/${{ env.FIREBASE_PROJECT_ID }}/g' .firebaserc | |
- uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
repoToken: "${{ secrets.GITHUB_TOKEN }}" | |
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_PLH_TEENS_APP1 }}" | |
projectId: ${{env.FIREBASE_PROJECT_ID}} | |
target: "${{env.FIREBASE_HOSTING_TARGET}}" | |
expires: 14d | |
env: | |
FIREBASE_CLI_PREVIEWS: hostingchannels |