ci: test "surge preview" deploy with several stages when the PR is created from a fork #5
Workflow file for this run
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: Surge PR Preview - Build Stage | |
on: | |
pull_request: | |
# keep in sync with the teardown stage | |
paths: | |
- '.github/workflows/surge-pr-fork-01-build.yml' | |
- '.github/workflows/surge-pr-fork-02-deploy.yml' | |
- 'public/surge/**/*' | |
jobs: | |
# TMP add a comment to trigger the wf in PR | |
build-preview: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build fake demo | |
if: ${{ github.event.action != 'closed' }} | |
env: | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
run: | | |
mkdir site | |
cp -r public/surge/* site/ | |
sed -i "s/@PR_NUMBER@/${PR_NUMBER}/g" site/index.html | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pr-build-dist # must be kept in sync with the artifact name downloaded in the deploy stage | |
path: site/ |