From 2d379d0010f6b2cd7b6d71fff93d4f46ffe164db Mon Sep 17 00:00:00 2001 From: Catherine Date: Fri, 12 May 2023 12:55:11 +0000 Subject: [PATCH] CI: publish docs to GitHub pages in forks, per branch. This is useful for previewing how documentation renders in a PR. --- .github/workflows/main.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c08c2f5..c66a3a5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -60,6 +60,9 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Pull tags from upstream repository + run: | + git pull --tags https://github.com/amaranth-lang/amaranth.git - name: Set up Python uses: actions/setup-python@v4 with: @@ -107,3 +110,25 @@ jobs: branch: main folder: docs/ target-folder: docs/amaranth/v${{ env.VERSION }}/ + publish-docs-dev: + needs: document + if: github.repository != 'amaranth-lang/amaranth' + runs-on: ubuntu-latest + steps: + - name: Check out source code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Download documentation archive + uses: actions/download-artifact@v3 + with: + name: docs + path: pages/docs/${{ github.ref_name }}/ + - name: Disable Jekyll + run: | + touch pages/.nojekyll + - name: Publish documentation for a branch + uses: JamesIves/github-pages-deploy-action@releases/v4 + with: + folder: pages/ + clean: false