v2.1.19 #10
Workflow file for this run
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
name: Release Events | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Environment to run tests against' | |
type: environment | |
required: true | |
permissions: | |
id-token: write | |
deployments: write | |
jobs: | |
deploy-dev-website: | |
name: Deploy staging website | |
runs-on: ubuntu-latest | |
environment: | |
name: dev | |
url: https://chalkdust.dev.utah.gov | |
if: github.event.release.prerelease == true || inputs.environment == 'dev' | |
steps: | |
- name: π Deploy website | |
uses: agrc/firebase-website-deploy-composite-action@v1 | |
with: | |
identity-provider: ${{ secrets.IDENTITY_PROVIDER }} | |
service-account-email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }} | |
project-id: ${{ secrets.PROJECT_ID }} | |
build-command: npm run build -- --mode dev | |
env: | |
VITE_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} | |
deploy-dev-service: | |
name: Deploy staging service | |
runs-on: ubuntu-latest | |
environment: | |
name: dev | |
if: github.event.release.prerelease == true || inputs.environment == 'dev' | |
steps: | |
- name: β¬οΈ Set up code | |
uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: ποΈ Authenticate to Google Cloud | |
id: auth | |
uses: google-github-actions/auth@v2 | |
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: π Deploy service | |
uses: google-github-actions/deploy-cloud-functions@v3 | |
timeout-minutes: 10 | |
with: | |
name: send-email-service | |
runtime: nodejs20 | |
source_dir: function | |
entry_point: sendgrid | |
service_timeout: 30s | |
max_instance_count: 2 | |
min_instance_count: 0 | |
memory: 128Mi | |
secrets: 'SENDGRID_API_KEY=projects/${{ secrets.PROJECT_ID }}/secrets/sendgrid' | |
service_account: function-sa@${{ secrets.PROJECT_ID }}.iam.gserviceaccount.com | |
deploy-prod-website: | |
name: Deploy production wesbite | |
runs-on: ubuntu-latest | |
environment: | |
name: prod | |
url: https://chalkdust.ugrc.utah.gov | |
if: github.event.release.prerelease == false || inputs.environment == 'prod' | |
steps: | |
- name: π Deploy website | |
uses: agrc/firebase-website-deploy-composite-action@v1 | |
with: | |
build-command: npm run build -- --mode production | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
project-id: ${{ secrets.PROJECT_ID }} | |
identity-provider: ${{ secrets.IDENTITY_PROVIDER }} | |
service-account-email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }} | |
service-now-instance: ${{ secrets.SN_INSTANCE }} | |
service-now-table: ${{ secrets.SN_TABLE }} | |
service-now-system-id: ${{ secrets.SN_SYS_ID }} | |
service-now-username: ${{ secrets.SN_USERNAME }} | |
service-now-password: ${{ secrets.SN_PASSWORD }} | |
env: | |
VITE_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} | |
deploy-prod-service: | |
name: Deploy production service | |
runs-on: ubuntu-latest | |
environment: | |
name: prod | |
url: https://chalkdust.ugrc.utah.gov | |
if: github.event.release.prerelease == false || inputs.environment == 'prod' | |
steps: | |
- name: β¬οΈ Set up code | |
uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: ποΈ Authenticate to Google Cloud | |
id: auth | |
uses: google-github-actions/auth@v2 | |
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: π Deploy service | |
uses: google-github-actions/deploy-cloud-functions@v3 | |
timeout-minutes: 10 | |
with: | |
name: send-email-service | |
runtime: nodejs20 | |
source_dir: function | |
entry_point: sendgrid | |
service_timeout: 30s | |
max_instance_count: 2 | |
min_instance_count: 0 | |
memory: 128Mi | |
secrets: 'SENDGRID_API_KEY=projects/${{ secrets.PROJECT_ID }}/secrets/sendgrid' | |
service_account: function-sa@${{ secrets.PROJECT_ID }}.iam.gserviceaccount.com |