Publishing javadoc for SpongePowered/SpongeAPI 12.1.0-SNAPSHOT #405
This file contains 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.10" | |
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-22.04" | |
steps: | |
- name: "checkout repository" | |
uses: "actions/checkout@v3" | |
- name: "setup python ${{ env.PYTHON_VERSION }}" | |
uses: "actions/setup-python@v4" | |
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/upload-pages-artifact@v1" | |
with: | |
path: "${{ env.DEST_DIR }}" | |
deploy: | |
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/data' }}" | |
needs: "build" | |
runs-on: "ubuntu-22.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/deploy-pages@v1" | |