diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index eb583e839..66abb013d 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -73,7 +73,7 @@ jobs: name: generated-docs-html path: docs/build/html - staeg: + stage: name: Stage runs-on: ubuntu-latest needs: @@ -85,7 +85,7 @@ jobs: permissions: contents: write - if: (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'new/doc-generation' )) || (github.ref_type == 'tag') + if: (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'new/doc-generation' )) || (github.event_name == 'release') steps: - name: Checkout the documentation branch continue-on-error: true @@ -103,7 +103,7 @@ jobs: - name: Ensure any previous documentation for this branch is removed run: rm -rf "./${{ github.ref_name }}" - - name: Download the artifact from the previous job + - name: Download the artifact from the build job uses: actions/download-artifact@v4 with: name: generated-docs-html @@ -126,3 +126,25 @@ jobs: git add .; git commit --allow-empty -m "Build ${{ github.ref_name }} from ${{ github.sha }}"; git push origin static/docs; + + upload-release-asset: + runs-on: ubuntu-latest + needs: + - build + if: github.event_name == 'release' + steps: + - name: Download the artifact from the previous job + uses: actions/download-artifact@v4 + with: + name: generated-docs-html + path: ".build/${{ github.ref_name }}" + + - name: Archive the built documentation + run: | + tar -czvf .build/docs.tar.gz ".build/${{ github.ref_name }}/*" + + - name: Upload the documentation as a release asset + uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 + with: + files: .build/docs.tar.gz + tag_name: ${{ github.ref_name }}