fix: workflow di pubblicazione #2
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 Docs to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'src/main/docs/**' | |
| - '.github/workflows/docs-publish.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build HTML and PDF | |
| run: | | |
| mkdir -p build | |
| # Genera HTML e PDF tramite container Docker asciidoctor/docker-asciidoctor | |
| docker run --rm -v ${{ github.workspace }}:/documents asciidoctor/docker-asciidoctor \ | |
| sh -c "asciidoctor -r asciidoctor-diagram -D /documents/build /documents/src/main/docs/index.adoc && \ | |
| asciidoctor-pdf -r asciidoctor-diagram -D /documents/build /documents/src/main/docs/index.adoc" | |
| - name: Upload Pages Artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: build | |
| deploy-docs: | |
| needs: build-docs | |
| 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@v4 |