Upload documentation directly if no artifact is defined.

This commit is contained in:
Patrick Lehmann
2022-11-06 21:31:51 +01:00
parent 8bc6ca673c
commit e9e62c5ef6
2 changed files with 18 additions and 25 deletions

View File

@@ -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

View File

@@ -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