From e9e62c5ef6e02bf24372343e021699f232f9fb32 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 6 Nov 2022 21:31:51 +0100 Subject: [PATCH] Upload documentation directly if no artifact is defined. --- .github/workflows/BuildTheDocs.yml | 19 +++++++++++++++++-- .github/workflows/Pipeline.yml | 24 +----------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/.github/workflows/BuildTheDocs.yml b/.github/workflows/BuildTheDocs.yml index d223e99..c1dd84c 100644 --- a/.github/workflows/BuildTheDocs.yml +++ b/.github/workflows/BuildTheDocs.yml @@ -27,11 +27,11 @@ on: inputs: artifact: description: 'Name of the documentation artifact.' - required: true + required: false + default: '' type: string jobs: - BuildTheDocs: name: 📓 Run BuildTheDocs runs-on: ubuntu-latest @@ -46,8 +46,23 @@ jobs: skip-deploy: true - name: 📤 Upload 'documentation' artifacts + if: inputs.artifact != '' uses: actions/upload-artifact@v3 with: name: ${{ inputs.artifact }} path: doc/_build/html retention-days: 1 + + - name: '📓 Publish site to GitHub Pages' + if: inputs.artifact == '' && github.event_name != 'pull_request' + run: | + cp --recursive -T doc/_build/html public + cd public + touch .nojekyll + git init + cp ../.git/config ./.git/config + git add . + git config --local user.email "BuildTheDocs@GitHubActions" + git config --local user.name "GitHub Actions" + git commit -a -m "update ${{ github.sha }}" + git push -u origin +HEAD:gh-pages diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 45d0aed..ecb5552 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -6,26 +6,4 @@ on: jobs: BuildTheDocs: - uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@r0 - with: - artifact: Documentation - - PublishToGitHubPages: - uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@r0 - needs: - - BuildTheDocs - with: - doc: Documentation - - ArtifactCleanUp: - name: 🗑️ Artifact Cleanup - needs: - - BuildTheDocs - - PublishToGitHubPages - runs-on: ubuntu-latest - - steps: - - name: 🗑️ Delete artifacts - uses: geekyeggo/delete-artifact@v2 - with: - name: Documentation + uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@dev