diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 4d1d96a..937b0ea 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -1,13 +1,25 @@ name: Deploy Javadocs to GitHub Pages +# Generate and deploy on push and request. on: push: - branches: - - main - - milo-ghp-javadoc + workflow_dispatch: +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +# Jobs jobs: - deploy: + # Generate the docs. + document: runs-on: ubuntu-latest steps: @@ -26,8 +38,15 @@ jobs: - name: Build and generate Javadocs run: ./gradlew generateDebugJavadoc -PgenerateUML --no-daemon + # Deploy the docs. + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: document + steps: - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + uses: actions/upload-pages-artifact@v1 with: - publish_dir: ./TeamCode/build/docs/javadoc/ - github_token: ${{ secrets.GITHUB_TOKEN }} + path: './TeamCode/build/docs/javadoc/'