Skip to content

Commit

Permalink
feat: add firebase deploy action for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Aug 24, 2022
1 parent dc60da4 commit 6a32dc9
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,52 @@ jobs:
with:
body: '[Change Log](https://github.com/agrc/wfrc-rtp-projects/blob/${{ github.ref_name}}/CHANGELOG.md)'
files: build.zip

deploy-dev:
runs-on: ubuntu-latest
needs: test
environment:
name: dev
url: https://wfrc-rtp.dev.utah.gov
if: github.ref == 'refs/heads/dev'

steps:
- name: ⬇️ Checkout Code
uses: actions/checkout@v3

- id: auth
name: 🗝️ Authenticate to Google Cloud
uses: google-github-actions/auth@v0
with:
access_token_scopes: 'email, openid, https://www.googleapis.com/auth/cloud-platform, https://www.googleapis.com/auth/firebase'
workload_identity_provider: ${{ secrets.IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
create_credentials_file: true

- name: ⎔ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: npm

- name: 📥 Download dependencies
run: npm ci

- name: 🏗 Run build script
run: npm run build:stage

- name: 🪣 Cache firebase
uses: actions/cache@v3
with:
path: ./.firebase
key: ${{ runner.OS }}-firebase-${{ hashFiles('**/*.cache') }}
restore-keys: |
${{ runner.OS }}-firebase-
${{ runner.OS }}-
- name: 🚀 Firebase deploy
run: >
npx firebase-tools deploy
--only hosting
--project ${{ secrets.PROJECT_ID }}
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ecma",
"fontawesome",
"fortawesome",
"hostingchannels",
"immer",
"languagedetector",
"montserrat",
Expand Down

0 comments on commit 6a32dc9

Please sign in to comment.