Skip to content

Commit

Permalink
[doit] add task DeployToGitHubPages
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Jul 13, 2021
1 parent 12b3ace commit a700c21
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
21 changes: 21 additions & 0 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,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",
}

0 comments on commit a700c21

Please sign in to comment.