Skip to content

Bump the github-actions group with 4 updates (#871) #880

Bump the github-actions group with 4 updates (#871)

Bump the github-actions group with 4 updates (#871) #880

name: Deploy to Firebase Hosting
on:
push:
branches:
- main
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
deploy-firebase:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.0.2
with:
ref: main
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v3.2.0
with:
node-version-file: '.nvmrc'
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
env:
CI: true
- name: Test Firebase Function
run: cd packages/functions && npm run test test/**.test.ts
- name: Authenticate
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193
with:
credentials_json: ${{ secrets.FIREBASE_SA_KEY }}
- name: Setup Cloud SDK
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a
with:
project_id: ${{ secrets.FIREBASE_PROJECT_ID }}
- name: Download Web Stories
run: |
gcloud storage cp "$BUCKET/stories" ./public --recursive
env:
BUCKET: ${{ secrets.FIREBASE_BUCKET_NAME }}
- name: Build website
run: cd packages/micro-site && npm run build
- name: Compress images for website
uses: calibreapp/image-actions@82caf2e46a1950e602c8440fde4730ec1da6fef4 # latest main from July 2, 2024.
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
compressOnly: true
ignorePaths: 'node_modules/**,packages/micro-site/**,public/static/**,public/e2e-tests/**,public/stories/**'
- name: Build XML Sitemap
run: node ./packages/sitemap-generator/index.js ./public/sitemap.xml
- name: Deploy to Firebase
uses: w9jds/firebase-action@553f21e6a2d29596407ea70cc42add642645b803 # v14.5.1
with:
# --force is required because we're using minInstances=1.
args: deploy --force
env:
GCP_SA_KEY: ${{ secrets.FIREBASE_SA_KEY }}
PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}