Update python-app.yml #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sphinx Build | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
paths: 'doc/**' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Sphinx Build | |
# You may pin to the exact commit or the version. | |
uses: ammaraskar/[email protected] | |
with: | |
# The folder containing your sphinx docs. | |
docs-folder: 'doc/' # default is docs/ | |
# The command used to build your documentation. | |
build-command: 'sphinx-build -b html . _build' # optional, default is make html | |
# Run before the build command, you can use this to install system level dependencies, for example with "apt-get update -y && apt-get install -y perl" | |
pre-build-command: 'python -m pip install sphinx_rtd_theme nbsphinx sphinxcontrib.bibtex sphinxcontrib.programoutput sphinxcontrib.contentui autodoc' | |
#- name: Upload a Build Artifact | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: 'html.zip' | |
# path: 'doc/_build/' | |
- name: Checkout neasqc.github.io | |
uses: actions/checkout@v2 | |
with: | |
ref: main | |
persist-credentials: true | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
repository: NEASQC/neasqc.github.io | |
path: "neasqc" | |
token: ${{ secrets.ACTION_TOKEN }} | |
- name: Create local changes | |
run: | | |
mkdir -p neasqc/Variationals_algorithms #Replace test with repo name | |
rm -rf neasqc/Variationals_algorithms/* #Replace test with repo name | |
cp -r doc/_build/* neasqc/Variationals_algorithms #Replace test with repo name | |
cd neasqc | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update documentation from github actions" || true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: main | |
directory: neasqc | |
repository: NEASQC/neasqc.github.io |