Skip to content

Commit

Permalink
CI: Delay publishing to GitHub Pages until job PublishToGitHubPages
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels authored Oct 17, 2021
2 parents 762544d + 7257845 commit 53bd8e1
Showing 1 changed file with 60 additions and 10 deletions.
70 changes: 60 additions & 10 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defaults:
shell: bash

jobs:

UnitTesting:
name: ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -107,7 +108,7 @@ jobs:
retention-days: 1

StaticTypeCheck:
name: πŸ“ˆ Check Static Typing using Python 3.10
name: πŸ‘€ Check Static Typing using Python 3.10
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -333,7 +334,7 @@ jobs:
python3 example.py
BuildTheDocs:
name: πŸ““ Run BuildTheDocs and publish to GH-Pages
name: πŸ““ Run BuildTheDocs
runs-on: ubuntu-latest
needs:
- VerifyDocs
Expand All @@ -354,10 +355,10 @@ jobs:
RUN apk add -U --no-cache graphviz
EOF
- name: πŸ›³οΈ Build documentation using container edaa/doc and publish to GitHub Pages
- name: πŸ›³οΈ Build documentation using container edaa/doc
uses: buildthedocs/btd@v0
with:
token: ${{ github.token }}
skip-deploy: true

- name: πŸ“€ Upload 'documentation' artifacts
uses: actions/upload-artifact@master
Expand All @@ -366,27 +367,76 @@ jobs:
path: doc/_build/html
retention-days: 7

ArtifactCleanUp:
name: πŸ—‘οΈ Artifact Cleanup
PublishToGitHubPages:
name: πŸ“š Publish to GH-Pages
runs-on: ubuntu-latest

needs:
- BuildTheDocs
- Coverage
- StaticTypeCheck

env:
DOC: ${{ needs.BuildTheDocs.outputs.artifact }}
COVERAGE: ${{ needs.Coverage.outputs.artifact }}
TYPING: ${{ needs.StaticTypeCheck.outputs.artifact }}
outputs:
artifact: ${{ env.ARTIFACT }}

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: πŸ“₯ Download artifacts '${{ env.DOC }}' from 'StaticTypeCheck' job
uses: actions/download-artifact@v2
with:
name: ${{ env.DOC }}
path: public

- name: πŸ“₯ Download artifacts '${{ env.COVERAGE }}' from 'Coverage' job
uses: actions/download-artifact@v2
with:
name: ${{ env.COVERAGE }}
path: public/coverage

- name: πŸ“₯ Download artifacts '${{ env.TYPING }}' from 'StaticTypeCheck' job
uses: actions/download-artifact@v2
with:
name: ${{ env.TYPING }}
path: public/typing

- name: 'πŸ““ Publish site to GitHub Pages'
if: github.event_name != 'pull_request'
run: |
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
ArtifactCleanUp:
name: πŸ—‘οΈ Artifact Cleanup
runs-on: ubuntu-latest
needs:
- Package
- PublishOnPyPI
- PublishToGitHubPages

env:
COVERAGE: ${{ needs.Coverage.outputs.artifact }}
TYPING: ${{ needs.StaticTypeCheck.outputs.artifact }}
PACKAGE: ${{ needs.Package.outputs.artifact }}
DOC: ${{ needs.BuildTheDocs.outputs.artifact }}

steps:
- name: πŸ—‘οΈ Delete all Artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: |
${{ env.COVERAGE }}
${{ env.TYPING }}
${{ env.PACKAGE }}
# ${{ env.COVERAGE }}
# ${{ env.TYPING }}
${{ env.DOC }}

0 comments on commit 53bd8e1

Please sign in to comment.