Publishing javadoc for SpongePowered/SpongeAPI 14.0.0-SNAPSHOT #479
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish JD | |
on: ["pull_request", "push"] | |
env: | |
DEST_DIR: _out | |
PYTHON_VERSION: "3.13" | |
jobs: | |
build: | |
# Only run on PRs if the source branch is on someone else's repo | |
if: "${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}" | |
runs-on: "ubuntu-24.04" | |
steps: | |
- name: "checkout repository" | |
uses: "actions/[email protected]" | |
- name: "setup python ${{ env.PYTHON_VERSION }}" | |
uses: "actions/[email protected]" | |
with: | |
python-version: "${{ env.PYTHON_VERSION }}" | |
- name: "install dependencies" | |
run: | | |
pip install poetry | |
pushd _generator | |
poetry install | |
- name: "generate site" | |
run: | | |
pushd _generator | |
poetry run generate-jd ../$DEST_DIR --metadata ../metadata.yaml --jd-root .. | |
- name: "publish" | |
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/data' }}" | |
uses: "actions/[email protected]" | |
with: | |
path: "${{ env.DEST_DIR }}" | |
deploy: | |
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/data' }}" | |
needs: "build" | |
runs-on: "ubuntu-24.04" | |
permissions: | |
pages: "write" | |
id-token: "write" | |
environment: | |
name: "github-pages" | |
url: "${{ steps.deployment.outputs.page_url }}" | |
steps: | |
- name: "Deploy to GitHub pages" | |
id: "deployment" | |
uses: "actions/[email protected]" | |