diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49beaa1..eda68cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,17 @@ -name: Build the website +name: Build and deploy a preview website on: pull_request: + types: + - opened + - reopened + - synchronize + - closed + +concurrency: preview-${{ github.ref }} jobs: - build-website: + build-and-deploy-website: runs-on: ubuntu-latest steps: - name: Checkout @@ -18,4 +25,12 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v4 with: - path: "./built-website" \ No newline at end of file + path: "./built-website" + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./built-website + preview-branch: gh-pages + umbrella-dir: chapter/pr-preview + pages-base-path: chapter + qr-code: true \ No newline at end of file