-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,75 +11,75 @@ jobs: | |
steps: | ||
# Remove the prefix "refs/*/" from $GITHUB_REF | ||
# Add var assignment to the $GITHUB_ENV file, so VERSION_TAG is available in later steps | ||
- name: Set VERSION_TAG env var | ||
- name: Set VERSION_TAG env var βοΈ | ||
run: echo "VERSION_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Eyeball VERSION_TAG env var | ||
- name: Eyeball VERSION_TAG env var π | ||
run: | | ||
echo $VERSION_TAG | ||
echo ${{ env.VERSION_TAG }} | ||
- name: Eyeball Git config | ||
- name: Eyeball Git config π | ||
run: git config --list | ||
|
||
- name: Check out VERSION_TAG | ||
- name: Check out VERSION_TAG π | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.VERSION_TAG }} | ||
|
||
- name: Check out a new branch | ||
- name: Check out a new branch π | ||
run: | | ||
branch_name="auto_add_tagged_docs_$VERSION_TAG" | ||
git checkout -b $branch_name | ||
echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV | ||
- name: Set up Python | ||
- name: Set up Python π | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install Poetry | ||
- name: Install Poetry π | ||
run: pip install poetry | ||
|
||
- name: Eyeball native environment | ||
- name: Eyeball native environment π | ||
run: python --version ; pip --version ; poetry --version ; pwd ; ls -la | ||
|
||
- name: Install package dependencies | ||
- name: Install package dependencies π | ||
run: poetry install | ||
|
||
- name: Install docs dependencies | ||
- name: Install docs dependencies π | ||
run: poetry run pip install -r docs/requirements.txt | ||
|
||
- name: Build HTML with config overrides | ||
- name: Build HTML with config overrides ποΈ | ||
run: | | ||
cd docs/ | ||
poetry run sphinx-build -M html source build -D release=$VERSION_TAG -D version=$VERSION_TAG -D html_extra_path=__ignore -D html_theme_options.switcher.version_match=$VERSION_TAG | ||
- name: Move built HTML to source extra dir | ||
- name: Move built HTML to source extra dir ποΈ | ||
run: | | ||
mkdir -p docs/source/extra/$VERSION_TAG | ||
mv docs/build/html/* docs/source/extra/$VERSION_TAG/ | ||
- name: Eyeball the Git status | ||
- name: Eyeball the Git status π | ||
run: git status -u | ||
|
||
- name: Configure Git user | ||
- name: Configure Git user βοΈ | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "_" | ||
- name: Add and commit all changes to the new branch, push to origin | ||
- name: Add and commit all changes to the new branch β | ||
run: | | ||
git add . | ||
git commit -m "Add documentation for $VERSION_TAG" | ||
- name: Push new branch upstream | ||
- name: Push new branch upstream π | ||
run: git push --set-upstream origin "$BRANCH_NAME" | ||
env: | ||
GH_PR: ${{ secrets.GH_PR }} | ||
|
||
# Note: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable. | ||
- name: Create pull request | ||
run: gh pr create -B main -H "$BRANCH_NAME" --title "Merge $BRANCH_NAME into main" --body 'Automated pull request from GitHub Actions workflow' | ||
- name: Create pull request π¦ | ||
run: gh pr create -B main -H "$BRANCH_NAME" --title "Merge $BRANCH_NAME into main" --body 'Automated pull request from GitHub Actions workflow.\n\nNote, you will still need to update `docs/source/extra/switcher.json` accordingly.' | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_PR }} |