diff --git a/.github/workflows/html-build.yml b/.github/workflows/html-build.yml index adb36b5..4fca58b 100644 --- a/.github/workflows/html-build.yml +++ b/.github/workflows/html-build.yml @@ -1,7 +1,10 @@ name: Rebuild all with asciidoctor +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read + pages: write + id-token: write on: push: @@ -13,6 +16,11 @@ on: branches: - main +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + jobs: # Build job build: @@ -28,9 +36,23 @@ jobs: run: | find . -name "*.asciidoc" -exec touch {} \; make all - - name: Upload Artifact - uses: actions/upload-artifact@v4 - if: always() + find . -type d -exec mkdir -p ../_site/{} \; + find . -name "*.html" -exec cp {} ../_site/{} \; + find ../_site -type d -empty -delete + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - name: HTML - path: ${{github.workspace}}/**/*.html + path: ../_site + + # Deployment job + deploy: + if: ${{ github.event_name == 'push'}} + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4