diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100644 index 000000000000..0bb068567d8c --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,29 @@ +name: Build pull request +on: + pull_request: + types: + - opened + - reopened + - synchronize +concurrency: build-${{ github.ref }} +jobs: + build: + runs-on: ubuntu-latest + # Run only on PRs from forks. + if: ${{ github.event.pull_request.head.repo.fork }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + submodules: true + # Build the website + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Build + run: | + npm ci + npm run build diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index f96098aa6cd2..77b956aaa385 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -10,6 +10,8 @@ concurrency: preview-${{ github.ref }} jobs: pr-preview: runs-on: ubuntu-latest + # Do not run on PRs from forks, since they don't have the permissions to deploy to our GitHub pages branch. + if: ${{ !github.event.pull_request.head.repo.fork }} steps: - name: Create app token uses: actions/create-github-app-token@v1