From 465fc24804d1447888f55781fa1b809dca3d07a8 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 16 Oct 2024 10:48:31 -0500 Subject: [PATCH] Add publishing to pages --- .github/workflows/html-build.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) 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