[doit] add initial doit file; add task DeployToGitHubPages

This commit is contained in:
umarcor 2021-09-18 22:32:02 +02:00
parent b542c38278
commit daff79af18
2 changed files with 36 additions and 10 deletions

View file

@ -93,14 +93,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 }}"

32
dodo.py Normal file
View file

@ -0,0 +1,32 @@
# doit
from sys import executable
from os import environ
from pathlib import Path
from doit.action import CmdAction
DOIT_CONFIG = {"verbosity": 2, "action_string_formatting": "both"}
ROOT = Path(__file__).parent
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",
}