Add Documentation CI Workflow (dependencies, translations) (#7208)

* Cleanup Circle CI configuration
This commit is contained in:
jonpas 2019-10-05 22:56:41 +02:00 committed by GitHub
parent 5a5d4758a0
commit faf6cfe57d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 31 deletions

24
.github/workflows/documentation.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: Documentation
on:
push:
branches:
- master
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
- name: Install Python packages
run: |
pip3 install wheel
pip3 install setuptools
pip3 install pygithub
pip3 install pygithub3
- name: Deploy
if: github.repository == 'acemod/ACE3' && ! contains(github.event.head_commit.message, '[ci skip]')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python3 tools/deploy.py

View File

@ -1,24 +0,0 @@
version: 2
jobs:
update-docs:
docker:
- image: acemod/armake:latest
steps:
- checkout
- run:
name: Update documentation and translation statistics
command: |
if [ "${CIRCLE_BRANCH}" == "master" ] && [ "${CIRCLE_PROJECT_USERNAME}" == "acemod" ]; then
python3 tools/deploy.py
else
echo "Skipping, not on acemod/ACE3 master branch..."
fi
workflows:
version: 2
build-job:
jobs:
- update-docs:
filters:
branches:
only: master

View File

@ -27,6 +27,8 @@ REPOUSER = "acemod"
REPONAME = "ACE3"
REPOPATH = "{}/{}".format(REPOUSER,REPONAME)
BRANCH = "master"
def update_translations(repo):
diag = sp.check_output(["python3", "tools/stringtablediag.py", "--markdown"])
@ -41,14 +43,11 @@ def update_dependencies(repo):
diff = str(diff, "utf-8")
if diff != "":
sha = repo.get_contents(DEPENDENCIESPATH
#, ref="travisForDocs" # Debug
).sha
sha = repo.get_contents(DEPENDENCIESPATH, ref=BRANCH).sha
repo.update_file(
path="/{}".format(DEPENDENCIESPATH),
message="[Docs] Update component dependencies\nAutomatically committed through Travis CI.\n\n[ci skip]",
content=dependencies, sha=sha, committer=InputGitAuthor("ace3mod", "ace3mod@gmail.com")
#, branch="travisForDocs" # Debug
path="{}".format(DEPENDENCIESPATH),
message="[Docs] Update component dependencies\nAutomatically committed through CI.\n\n[ci skip]",
content=dependencies, sha=sha, committer=InputGitAuthor("ace3mod", "ace3mod@gmail.com"), branch=BRANCH
)
print("Dependencies successfully updated.")
else: