Skip to content

profile-update

profile-update #264

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Deploy to Hugo site to Firebase Hosting on merge
on:
push:
branches:
- trunk
paths:
- "hugo/**"
- "firebase.json"
repository_dispatch:
types: [profile-update]
jobs:
build_and_deploy:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}:trunk
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: bun install
- name: Sync profiles from Firestore
run: bun scripts/sync-profiles-to-hugo.ts
env:
FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_DOULA_COOPERATIVE }}
- name: Build Hugo site
run: bun run build
env:
# Hugo templates use {{ os.Getenv "VAR_NAME" }} to read these
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_LIVE_PUBLISHABLE_KEY }}
STRIPE_PRICING_TABLE_ID: ${{ secrets.STRIPE_LIVE_PRICING_TABLE_ID }}
STRIPE_VISIBILITY_KEY: ${{ secrets.STRIPE_VISIBILITY_KEY }}
- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_DOULA_COOPERATIVE }}
channelId: live
projectId: doula-cooperative
target: main-site
- name: Notify Profile Updates
if: >-
success() &&
github.event_name == 'repository_dispatch' &&
github.event.client_payload.notificationType
run: |
curl -s -X POST https://doulacooperative.com/api/profile-webhook \
-H "Content-Type: application/json" \
-d '{
"slug": "${{ github.event.client_payload.slug }}",
"notificationType": "${{ github.event.client_payload.notificationType }}",
"secret": "${{ secrets.DEPLOY_WEBHOOK_SECRET }}"
}'
continue-on-error: true