Skip to content

build(deps): Bump dotenv from 16.0.1 to 16.4.7 #1835

build(deps): Bump dotenv from 16.0.1 to 16.4.7

build(deps): Bump dotenv from 16.0.1 to 16.4.7 #1835

name: Generate Preview
on:
pull_request_target:
types: [labeled]
permissions:
contents: read
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
if: github.event.label.name == 'create-preview'
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup GCloud
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Remove create-preview 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: Install Dependencies
run: npm ci
- name: Run Gatsby Build
run: npm run build-ci
env:
PATH_PREFIX: ${{ github.event.pull_request.number }}/
- name: Upload to GCS
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 }}/'
});