|
| 1 | +# Security Notes |
| 2 | +# Only selected Actions are allowed within this repository. Please refer to (https://github.com/nodejs/nodejs.org/settings/actions) |
| 3 | +# for the full list of available actions. If you want to add a new one, please reach out a maintainer with Admin permissions. |
| 4 | +# REVIEWERS, please always double-check security practices before merging a PR that contains Workflow changes!! |
| 5 | +# AUTHORS, please only use actions with explicit SHA references, and avoid using `@master` or `@main` references or `@version` tags. |
| 6 | + |
| 7 | +# Note: this is a temporary workflow for deploying the OpenNext version of the site (hosted on https://node-test.org) |
| 8 | +# this version of the site is just used for testing purposes and ideally we want to keep it in syn with the |
| 9 | +# official website |
| 10 | + |
| 11 | +name: Deploy the Cloudflare OpenNext test version of the site (https://node-test.org) |
| 12 | + |
| 13 | +on: |
| 14 | + push: |
| 15 | + branches: |
| 16 | + - main |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: read |
| 24 | + actions: read |
| 25 | + |
| 26 | +jobs: |
| 27 | + playwright: |
| 28 | + name: Deploy Open-Next site |
| 29 | + runs-on: ubuntu-latest |
| 30 | + |
| 31 | + steps: |
| 32 | + - name: Harden Runner |
| 33 | + uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 |
| 34 | + with: |
| 35 | + egress-policy: audit |
| 36 | + |
| 37 | + - name: Git Checkout |
| 38 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 39 | + with: |
| 40 | + fetch-depth: 2 |
| 41 | + |
| 42 | + - name: Set up pnpm |
| 43 | + uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 |
| 44 | + |
| 45 | + - name: Set up Node.js |
| 46 | + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 |
| 47 | + with: |
| 48 | + # We want to ensure that the Node.js version running here respects our supported versions |
| 49 | + node-version-file: '.nvmrc' |
| 50 | + cache: 'pnpm' |
| 51 | + |
| 52 | + - name: Install packages |
| 53 | + run: pnpm install --frozen-lockfile |
| 54 | + |
| 55 | + - name: Build open-next site |
| 56 | + working-directory: apps/site |
| 57 | + run: node --run cloudflare:build:worker |
| 58 | + |
| 59 | + - name: Deploy open-next site |
| 60 | + working-directory: apps/site |
| 61 | + run: node --run cloudflare:deploy |
| 62 | + env: |
| 63 | + CF_WORKERS_SCRIPTS_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN_FOR_OPEN_NEXT_SITE }} |
| 64 | + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN_FOR_OPEN_NEXT_SITE }} |
0 commit comments