Create build_documentation_and_commit_to_website_repo.yml #1
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: Build and Commit Documentation to Website Repo | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code repository | |
uses: actions/checkout@v4 | |
with: | |
path: code | |
- name: Checkout website repository | |
uses: actions/checkout@v4 | |
with: | |
repository: eclipse-wattadvisor/website | |
path: website | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Sphinx packages | |
run: pip install sphinx sphinx-autoapi sphinx-math-dollar myst-nb sphinx-rtd-theme | |
- name: Build Documentation | |
run: | | |
cd code/docs | |
make html | |
- name: Copy Documentation to Repository B | |
run: cp -r code/docs/build/html/* website | |
- name: Commit and Push Changes | |
run: | | |
cd website | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git add -A | |
git commit -m "Update documentation" | |
git push |