Bump serve-static and express #1108
Workflow file for this run
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: Deploy PR to Firebase | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
workflow_dispatch: | |
inputs: | |
prNumber: | |
description: 'Number of the PR to deploy' | |
required: true | |
jobs: | |
deploy-dev-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: false | |
- uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: 22 | |
check-latest: true | |
cache: 'npm' | |
- name: Get Hugo Version | |
id: hugo-version | |
run: | | |
version=$(jq -r .hugo "scripts/.util/tools.json") | |
echo "version=${version#v}" >> "$GITHUB_OUTPUT" | |
- name: Checkout PR | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
gh pr checkout ${{ github.event.inputs.prNumber }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: ${{ steps.hugo-version.outputs.version }} | |
extended: true | |
- name: Install node Modules | |
run: npm ci | |
- name: Setup GCP Auth | |
id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCP_SA_KEY }} | |
- name: Setup GCloud | |
uses: google-github-actions/setup-gcloud@v2.1.2 | |
with: | |
export_default_credentials: true | |
- name: Disable Crawling on staging site | |
run: | | |
printf "User-agent: *\nDissallow: /\n" > layouts/robots.txt | |
- name: Build | |
run: hugo | |
- name: Switch Back to Original Branch # Built contents in /public is unaffected | |
if: github.event_name == 'workflow_dispatch' | |
run: git checkout - | |
- name: Deploy | |
id: deploy | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const deploy = require('./deploy.js') | |
await deploy({ expires: '72h' }) | |
- name: Comment with Staging Link (by PR number) | |
if: github.event_name == 'workflow_dispatch' | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
number: ${{ github.event.inputs.prNumber }} | |
message: | | |
PR deployed to: ${{ steps.deploy.outputs.staging_url }} | |
Expires at: ${{ steps.deploy.outputs.expiration }} | |
- name: Comment with Staging Link | |
if: github.event_name != 'workflow_dispatch' | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
message: | | |
PR deployed to: ${{ steps.deploy.outputs.staging_url }} | |
Expires at: ${{ steps.deploy.outputs.expiration }} |