Skip to content

Commit

Permalink
Merge pull request #1062 from PrimeDAO/development
Browse files Browse the repository at this point in the history
chore(firebase): update firebase token flow with env guard
  • Loading branch information
hiaux0 authored Jun 20, 2022
2 parents 82c4161 + 3181982 commit 34be5fd
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/deployFirebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,27 @@ on:
push:
branches: [ development, staging, staging-mainnet, master ]
jobs:
Get_environment:
runs-on: ubuntu-latest
steps:
- name: Get environment
id: branch_check
run: |
echo "Running on branch ${{ github.ref }}"
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
echo "::set-output name=env_name::Production"
else
echo "::set-output name=env_name::Preview"
fi
- name: Use variable setup in previous step
run: echo "I'm using variable ${{ steps.branch_check.outputs.env_name }}"
outputs:
env_name: ${{ steps.branch_check.outputs.env_name }}

Deploy_firebase:
runs-on: ubuntu-latest
environment: Production
needs: Get_environment
environment: ${{ needs.Get_environment.outputs.env_name }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand All @@ -20,5 +38,6 @@ jobs:
cd firebaseFunctions
touch .env
echo "RIVET_ID=${{ secrets.RIVET_ID }}" >> .env
- name: Deploy firebase
run: npm run firebase-deploy:${GITHUB_REF_NAME} -- --token ${{ secrets.FIREBASE_TOKEN }}

1 comment on commit 34be5fd

@vercel
Copy link

@vercel vercel bot commented on 34be5fd Jun 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.