name: Build Docs on: workflow_call: inputs: schemas_artifact: description: "Name of the artifact that has updated schemas, set to `null` to not update" default: "null" required: false type: string push: branches: [main] paths: - docs/** - NewHorizons/Schemas/* - .github/workflows/docs_build.yml permissions: contents: read pages: write id-token: write concurrency: group: "pages" cancel-in-progress: true jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Download Schemas if: ${{ inputs.schemas_artifact != 'null' }} uses: actions/download-artifact@v3 with: name: ${{ inputs.schemas_artifact }} path: NewHorizons/Schemas - name: PNPM Sucks run: | cp docs/package.json . cp docs/pnpm-lock.yaml . - name: Setup PNPM uses: pnpm/action-setup@v2 - name: Build Site working-directory: docs run: | pnpm install pnpm build - name: Upload Pages artifact uses: actions/upload-pages-artifact@v2 with: path: ./docs/dist deploy: needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v1