Skip to content

contentful.deploy

contentful.deploy #177

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: "[merge] Deploy to Firebase Hosting on merge"
"on":
push:
branches:
- main
repository_dispatch:
types: [contentful.deploy]
jobs:
build_and_deploy:
name: Build and deploy to PROD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
- run: yarn install --immutable --immutable-cache
- run: yarn build
env:
CONTENTFUL_SPACE_ID: "${{ secrets.CONTENTFUL_SPACE_ID }}"
CONTENTFUL_DELIVERY_TOKEN: "${{ secrets.CONTENTFUL_DELIVERY_TOKEN }}"
- name: Deploy to PROD site
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_FRIENDS_OF_FOXLEY_PROD }}"
channelId: live
projectId: friends-of-foxley-prod
deploy_preview_api:
name: Build and deploy to Preview API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
- run: yarn install --immutable --immutable-cache
- run: yarn build
env:
CONTENTFUL_SPACE_ID: "${{ secrets.CONTENTFUL_SPACE_ID }}"
CONTENTFUL_DELIVERY_TOKEN: "${{ secrets.CONTENTFUL_DELIVERY_TOKEN }}"
CONTENTFUL_HOST: "preview.contentful.com"
CONTENTFUL_PREVIEW_ACCESS_TOKEN: "${{ secrets.CONTENTFUL_PREVIEW_ACCESS_TOKEN }}"
- name: Deploy to preview site
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_FRIENDS_OF_FOXLEY_PROD }}"
channelId: friends-of-foxley-preview
projectId: friends-of-foxley-prod