diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..e4bcdd67 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,41 @@ +--- +name: Deploy PR previews + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed + +permissions: + contents: write + +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - name: Checkout-repository + uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install -r requirements.txt + - name: Build the book + run: make book + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: src/_build/html + token: ${{ secrets.GITHUB_TOKEN }} + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto