diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9fb941b..c08c2f5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,6 +71,21 @@ jobs: - name: Build documentation run: | sphinx-build docs docs/_build + - name: Upload documentation archive + uses: actions/upload-artifact@v3 + with: + name: docs + path: docs/_build + publish-docs: + needs: document + if: github.repository == 'amaranth-lang/amaranth' + runs-on: ubuntu-latest + steps: + - name: Download documentation archive + uses: actions/download-artifact@v3 + with: + name: docs + path: docs/ - name: Publish development documentation if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' uses: JamesIves/github-pages-deploy-action@releases/v4 @@ -78,7 +93,7 @@ jobs: repository-name: amaranth-lang/amaranth-lang.github.io ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }} branch: main - folder: docs/_build + folder: docs/ target-folder: docs/amaranth/latest/ - name: Extract release version if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') @@ -90,5 +105,5 @@ jobs: repository-name: amaranth-lang/amaranth-lang.github.io ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }} branch: main - folder: docs/_build + folder: docs/ target-folder: docs/amaranth/v${{ env.VERSION }}/