Skip to content

Deploy to Firebase Hosting on merge #328

Deploy to Firebase Hosting on merge

Deploy to Firebase Hosting on merge #328

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Deploy to Firebase Hosting on merge
on:
workflow_run:
workflows:
- CI
types:
- completed
branches:
- main
workflow_dispatch:
repository_dispatch:
types:
- upload_entry
jobs:
build_and_deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.client_payload.deploy }}
runs-on: ubuntu-latest
env:
PUBLIC_SITE_URL: https://k2ss.info
CONTENTFUL_SPACE: ${{ secrets.CONTENTFUL_SPACE }}
CONTENTFUL_ENVIRONMENT: ${{ secrets.CONTENTFUL_ENVIRONMENT }}
CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }}
CONTENTFUL_PREVIEW_TOKEN: ${{ secrets.CONTENTFUL_PREVIEW_TOKEN }}
PREVIEW_SECRET: dummy # 開発時しか利用しないので適当な値を設定しておく
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.17'
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BLOG_F0FB3 }}'
channelId: live
projectId: blog-f0fb3