build(deps-dev): Bump eslint-plugin-testing-library from 5.6.0 to 7.1.1 #1841
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: 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 }}/' | |
}); |