diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 21065a26d..267f91cc1 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -96,14 +96,8 @@ jobs: NEORV32-SITE-nightly.tar.gz pdf/NEORV32*nightly.pdf + - name: '🐍 Install doit' + run: pip install doit + - name: '🚀 Deploy to GitHub-Pages' - run: | - cd public - git init - cp ../.git/config ./.git/config - touch .nojekyll - git add . - git config --local user.email "push@gha" - git config --local user.name "GHA" - git commit -am "update ${{ github.sha }}" - git push -u origin +HEAD:gh-pages + run: doit DeployToGitHubPages "update ${{ github.sha }}" diff --git a/dodo.py b/dodo.py index 5165ced32..938940a47 100644 --- a/dodo.py +++ b/dodo.py @@ -182,3 +182,24 @@ def task_Documentation(): "uptodate": [False], "pos_arg": "posargs", } + + +def task_DeployToGitHubPages(): + cwd = str(ROOT / "public") + return { + "actions": [ + CmdAction(cmd, cwd=cwd) + for cmd in [ + "git init", + "cp ../.git/config ./.git/config", + "touch .nojekyll", + "git add .", + 'git config --local user.email "push@gha"', + 'git config --local user.name "GHA"', + "git commit -am '{posargs}'", + "git push -u origin +HEAD:gh-pages", + ] + ], + "doc": "Create a clean branch in subdir 'public' and push to branch 'gh-pages'", + "pos_arg": "posargs", + }