From 1911c025bd3360f065e7a60872c89bdfc6d4bdbb Mon Sep 17 00:00:00 2001 From: GDeLaurentis Date: Thu, 23 May 2024 20:27:59 +0100 Subject: [PATCH] New docs workflow, fixing some syntax in workflows. --- .github/workflows/cd_docs.yml | 56 +++++++++++++++++++ .../{pypi_release.yml => cd_pypi.yml} | 0 .github/workflows/ci_lint.yml | 3 - .github/workflows/ci_test.yml | 3 - 4 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/cd_docs.yml rename .github/workflows/{pypi_release.yml => cd_pypi.yml} (100%) diff --git a/.github/workflows/cd_docs.yml b/.github/workflows/cd_docs.yml new file mode 100644 index 0000000..ce3d116 --- /dev/null +++ b/.github/workflows/cd_docs.yml @@ -0,0 +1,56 @@ +name: Documentation + +on: + release: + types: [created] + workflow_dispatch: + +jobs: + + BuildDocs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Checkout this Repo + uses: actions/checkout@v3 + with: + path: . + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install sphinx sphinx-rtd-theme + pip install -e . + - name: Build docs + run: | + cd sphinx + make github + - name: setup git config + run: | + git config user.name "GitHub Actions Bot" + git config user.email "<>" + - name: Commit docs to gh-pages branch + run: | + cp -r docs/ docs.back/ + echo "fetching..." + git fetch + git reset --hard + echo "checking out gh-pages..." + git checkout gh-pages + rm -r docs/ + cp -r docs.back/ docs/ + touch docs/.nojekyll + git checkout main README.md + git add -f docs/.nojekyll + git add -f docs/.buildinfo + git add README.md docs/* + echo "committing changes if needed..." + git status + if ! git diff-index --quiet HEAD; then + git commit -m "Automated docs update." + git push origin gh-pages + fi diff --git a/.github/workflows/pypi_release.yml b/.github/workflows/cd_pypi.yml similarity index 100% rename from .github/workflows/pypi_release.yml rename to .github/workflows/cd_pypi.yml diff --git a/.github/workflows/ci_lint.yml b/.github/workflows/ci_lint.yml index 62aee3c..7ccf91d 100644 --- a/.github/workflows/ci_lint.yml +++ b/.github/workflows/ci_lint.yml @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - name: CI Lint on: @@ -8,7 +6,6 @@ on: pull_request: branches: [ main ] workflow_dispatch: - branches: [ main ] jobs: diff --git a/.github/workflows/ci_test.yml b/.github/workflows/ci_test.yml index dd7fb4b..6750455 100644 --- a/.github/workflows/ci_test.yml +++ b/.github/workflows/ci_test.yml @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - name: CI Test on: @@ -8,7 +6,6 @@ on: pull_request: branches: [ main ] workflow_dispatch: - branches: [ main ] jobs: