Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix update-doc-versions job #143

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,8 @@ jobs:
with:
ref: gh-pages
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Generate versions.json
shell: python3 {0}
run: |
Expand All @@ -549,17 +551,15 @@ jobs:
versions = sorted((item.name for item in cwd.iterdir()
if item.is_dir() and not item.name.startswith('.')),
reverse=True)
target_dir = Path('gh-pages')
target_dir.mkdir(parents=True)
target_file = target_dir / 'versions.json'
target_file = Path('versions.json')
with target_file.open('w') as f:
json.dump(versions, f)
- name: Commit versions.json
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: gh-pages # The folder the action should deploy.
target-folder: / # The folder the action should deploy to.
commit-message: publish documentation
clean: false # do not remove other files (including whole doc versions)
single-commit: true
shell: bash
run: |
# Commit versions.json and squash it with previous commit
git config user.name "Actions"
git config user.email "[email protected]"
git add versions.json
git commit --amend --no-edit
git push -f origin gh-pages