Skip to content

Commit

Permalink
Simplified versions logic (#2346)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChen2023 authored Nov 13, 2023
1 parent 7d52701 commit 71c0ceb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/deploy-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@ jobs:
git fetch origin gh-pages --depth=1 # fix mike's CI update
mike list
mike deploy ${{ env.ACTIONTEST }} -p --rebase
# The set-default command is only applicable to the latest version and must be commented in older versions.
# mike set-default ${{ env.ACTIONTEST }} -p --rebase
# mike list

# - name: Deploy
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.DEPLOY_TOKEN }}
# publish_dir: ./site
28 changes: 1 addition & 27 deletions .github/workflows/deploy-zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,47 +36,21 @@ jobs:
- name: Git Config
run: git config user.name ChrisChen2023 && git config user.email chris.chen@vesoft.com

- name: save tmp file
run: |
cp -f *versions.json /tmp/
ls /tmp/ -ltr

- name: Mike Deploy
run: |
python ./scripts/render_chinese_only.py
git fetch origin gh-pages-zh --depth=1 # fix mike's CI update
mike list
mike deploy ${{ env.ACTIONTEST }} -b gh-pages-zh -p --rebase
# The set-default command is only applicable to the latest version and must be commented in older versions.
# mike set-default ${{ env.ACTIONTEST }} -b gh-pages-zh -p --rebase
# mike list


- name: show Chinese git branches
run: |
git branch
git checkout .
git checkout gh-pages-zh
- name: add existing version
run: |
import yaml, json
new_content = {"version": "${{ env.ACTIONTEST }}", "title": "${{ env.ACTIONTEST }}", "aliases": []}
filename = "/tmp/community_versions.json"
with open(filename, 'r') as infile:
json_data = json.load(infile)
found = False
for item in json_data:
if item['version'] == new_content['version']: # in case duplicate master branch
found = True
break
if not found:
json_data.append(new_content)
json_data = sorted(json_data, key=lambda x: x['version'], reverse=True)
with open('./versions.json', 'w') as outfile:
json.dump(json_data, outfile, indent=2)
shell: python
git checkout gh-pages-zh
- name: Compress
run: |
Expand Down

0 comments on commit 71c0ceb

Please sign in to comment.