Skip to content

Instantly share code, notes, and snippets.

@hscheuerle
Created June 7, 2021 00:03
Show Gist options
  • Save hscheuerle/1f4e18e9c632889f66233da18f59075a to your computer and use it in GitHub Desktop.
Save hscheuerle/1f4e18e9c632889f66233da18f59075a to your computer and use it in GitHub Desktop.
name: Deploy to Firebase Hosting on merge
"on":
push:
branches:
- master
- development
jobs:
build_and_deploy:
runs-on: ubuntu-latest
env:
IDS: '{ "refs/heads/master": "hscheue-workspace", "refs/heads/development": "work-development-6804b" }'
SA: '{ "refs/heads/master": "FIREBASE_SERVICE_ACCOUNT_HSCHEUE_WORKSPACE", "refs/heads/development": "FIREBASE_SERVICE_ACCOUNT_WORK_DEVELOPMENT_6804B" }'
C: '{ "refs/heads/master": "production", "refs/heads/development": "development" }'
steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run build -c "${{ fromJson(env.C)[github.ref] }}"
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets[fromJson(env.SA)[github.ref]] }}"
projectId: "${{ fromJson(env.IDS)[github.ref] }}"
channelId: live
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment