Skip to content

Instantly share code, notes, and snippets.

@hscheuerle
Created June 7, 2021 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hscheuerle/346acae026a6bdde9e104c1665f722bc to your computer and use it in GitHub Desktop.
Save hscheuerle/346acae026a6bdde9e104c1665f722bc to your computer and use it in GitHub Desktop.
name: Deploy to Firebase Hosting on PR
"on": pull_request
jobs:
build_and_preview:
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
runs-on: ubuntu-latest
env:
IDS: '{ master: "hscheue-workspace", development: "work-development-6804b" }'
SA: '{ master: "FIREBASE_SERVICE_ACCOUNT_HSCHEUE_WORKSPACE", development: "FIREBASE_SERVICE_ACCOUNT_WORK_DEVELOPMENT_6804B" }'
C: '{ master: "production", development: "development" }'
steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run build -c "${{ fromJson(env.C)[github.base_ref] }}"
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets[fromJson(env.SA)[github.base_ref]] }}"
projectId: "${{ fromJson(env.IDS)[github.base_ref] }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment