Add scheduler name (#2295) #2754
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: Publish docs via GitHub Pages | |
on: | |
push: | |
branches: | |
# Remember to add v before the following version number unless the version is master. | |
- v3.5.0-sc | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # fetch all commits/branches for gitversion | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.8' | |
architecture: 'x64' | |
- name: prepare | |
run: sh ./prepare.sh | |
- name: Git Config | |
run: git config user.name whitewum && git config user.email [email protected] | |
- name: Mike Deploy 3.5.0-sc | |
run: | | |
# mike delete 3.5.0 -p | |
git fetch origin gh-pages --depth=1 # fix mike's CI update | |
mike deploy 3.5.0-sc -p --rebase | |
mike list | |
- name: show git branch | |
run: | | |
git branch | |
git checkout . | |
git checkout gh-pages | |
- name: Modify versions.json | |
run: | | |
import json | |
new_content = {'version': '3.5.0-sc', 'title': '3.5.0-sc', 'aliases': []} | |
try: | |
with open('./versions.json', 'r') as f: | |
data = json.load(f) | |
# Remove the version from the list | |
data = [item for item in data if item.get('version') != new_content['version']] | |
# If you want to add it back to the end, uncomment the next line | |
# data.append(new_content) | |
with open('./versions.json', 'w') as outfile: | |
json.dump(data, outfile, indent=2) | |
except Exception as e: | |
print(f"An error occurred: {e}") | |
exit(1) | |
shell: python | |
# not public this branch; but push to web service | |
# - name: Deploy | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# github_token: ${{ secrets.DEPLOY_TOKEN }} | |
# publish_dir: ./site |