From 988ab8fe5e0bc5a328e6dc92c3bef6b128aad359 Mon Sep 17 00:00:00 2001 From: umarcor Date: Thu, 8 Jul 2021 04:41:12 +0200 Subject: [PATCH] [doit] add task DeployToGitHubPages --- .github/workflows/Documentation.yml | 14 ++++---------- dodo.py | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 21065a26da..267f91cc1c 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 5165ced32d..938940a47b 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", + }