Merge pull request #446 from hideo54/dependabot/npm_and_yarn/function… #372
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
# https://github.com/google-github-actions/deploy-cloud-functions | |
name: Deploy to Cloud Functions and Firebase Hosting on merge | |
'on': | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
concurrency: build_and_deploy | |
env: | |
NEXT_TELEMETRY_DISABLED: 1 # https://nextjs.org/telemetry | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
ssh-key: '${{ secrets.ARCHIVES_DEPLOY_KEY }}' | |
- uses: actions/cache@v2 | |
# https://nextjs.org/docs/messages/no-cache#github-actions | |
with: | |
path: ${{ github.workspace }}/.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
- run: npm ci && npm run build && npm run export | |
- run: npm ci && npm run build | |
working-directory: ./functions | |
- uses: 'google-github-actions/auth@v0' | |
with: | |
credentials_json: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_HIDEO54 }}' | |
- uses: 'google-github-actions/deploy-cloud-functions@v2' | |
with: | |
name: hatenaStars | |
runtime: nodejs20 | |
region: asia-northeast1 | |
source_dir: functions | |
- uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
repoToken: '${{ secrets.GITHUB_TOKEN }}' | |
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_HIDEO54 }}' | |
channelId: live | |
projectId: hideo54 |