Replace FIREBASE_TOKEN by GOOGLE_APPLICATION_CREDENTIALS #57
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
name: Main | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
name: Build and Deploy | |
runs-on: macos-latest | |
env: | |
BUNDLE_WITHOUT: development | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Ruby 3.1 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
bundler-cache: true | |
- name: Install ImageMagick | |
run: brew install imagemagick@7 | |
- name: Cache nanoc | |
id: cache-nanoc | |
uses: actions/cache@v4 | |
with: | |
path: output | |
key: ${{ runner.os }}-nanoc-prod-v2-${{ hashFiles('content/**', 'Rules', 'nanoc.yaml', 'lib/**', 'layouts/**') }} | |
restore-keys: | | |
${{ runner.os }}-nanoc-prod-v2- | |
- name: Build | |
id: build | |
run: | | |
export LANG=en_US.UTF-8 | |
export LANGUAGE=en_US:en | |
export LC_ALL=en_US.UTF-8 | |
bundle exec nanoc compile --env=prod -V | |
- name: Setup Node | |
if: steps.build.outputs.need_deploy == 0 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Deploy prod | |
env: | |
GIT_SHA: ${{ github.sha }} | |
GOOGLE_APPLICATION_CREDENTIALS_BASE64: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_BASE64 }} | |
run: | | |
npm ci | |
export GOOGLE_APPLICATION_CREDENTIALS="/tmp/google_creds.json" | |
echo "${GOOGLE_APPLICATION_CREDENTIALS_BASE64}" | base64 -d > "${GOOGLE_APPLICATION_CREDENTIALS}" | |
node_modules/.bin/firebase deploy --only hosting -m "GitHub Actions@${GIT_SHA::8}" --non-interactive |