Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

build(deps): Bump gatsby-plugin-sharp from 4.25.0 to 4.25.1 #2831

build(deps): Bump gatsby-plugin-sharp from 4.25.0 to 4.25.1

build(deps): Bump gatsby-plugin-sharp from 4.25.0 to 4.25.1 #2831

name: Generate Preview
on:
pull_request_target:
types: [labeled]
permissions:
contents: read
pull-requests: write
jobs:
generate-preview:
environment:
name: firebase-staging
url: 'https://staging.nodejs.dev/${{ github.event.pull_request.number }}/'
runs-on: ubuntu-latest
if: github.event.label.name == 'create-preview'
steps:
- name: Git Checkout
uses: actions/checkout@v3.3.0
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Auth G Cloud
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NODEJS_INFRASTRUCTURE }}'
- name: Setup G Cloud
uses: google-github-actions/setup-gcloud@v1
- name: Remove the PR Label
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.removeLabel({
issue_number: ${{ github.event.pull_request.number }},
owner: context.repo.owner,
repo: context.repo.repo,
name: ['create-preview']
})
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install NPM packages
run: npm ci
- uses: jongwooo/gatsby-cache@v1.4.1
with:
key: generate-preview-gatsby-ubuntu-latest
- name: Build Gatsby
run: npm run build-ci
env:
PATH_PREFIX: ${{ github.event.pull_request.number }}/
- name: Upload to G Cloud Storage
run: gsutil -m rsync -R public gs://staging.nodejs.dev/${{ github.event.pull_request.number }}/
- name: Comment on PR
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.pull_request.number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Please find a preview at: https://staging.nodejs.dev/${{ github.event.pull_request.number }}/'
});