Update publish script (#3084) #4285
This file contains hidden or 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: | |
| - v3.4.3 | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 1 # fetch all commits/branches | |
| - name: Setup Python | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: '3.10.17' | |
| architecture: 'x64' | |
| - name : prepare | |
| run: sh ./prepare.sh | |
| - name: Git Config | |
| run: git config user.name whitewum && git config user.email min.wu@vesoft.com | |
| - name: mike | |
| run: | | |
| git fetch origin gh-pages --depth=1 # fix mike's CI update | |
| mike deploy 3.4.3 -p --rebase | |
| mike list | |
| - name: show git branch | |
| run: | | |
| git branch | |
| git checkout . | |
| git checkout gh-pages | |
| - name: Compress | |
| run: | | |
| tar -vczf nebula-docs.tar.gz 3.4.3 versions.json *.html | |
| - name: Transfer | |
| # uses: garygrossgarten/github-action-scp@release | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.USER_NAME }} | |
| password: ${{ secrets.PASSWORD }} | |
| port: ${{ secrets.PORT }} | |
| source: nebula-docs.tar.gz | |
| target: /usr/web | |
| - name: UnCompress | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.USER_NAME }} | |
| password: ${{ secrets.PASSWORD }} | |
| port: ${{ secrets.PORT }} | |
| script: | | |
| mkdir -p /usr/web/nebula-docs/ | |
| tar -xzf /usr/web/nebula-docs.tar.gz -C /usr/web/nebula-docs/ | |
| mkdir -p /usr/web/nebula-docs/site/pdf/ | |
| cp -f /usr/web/nebula-docs/3.4.3/pdf/NebulaGraph-CN.pdf /usr/web/nebula-docs/site/pdf/NebulaGraph-book.pdf | |
| # pip3 install --upgrade pip | |
| # pip3 install -r /usr/web/nebula-docs/requirement.txt | |
| # - name: Deploy | |
| # uses: peaceiris/actions-gh-pages@v3 | |
| # with: | |
| # github_token: ${{ secrets.DEPLOY_TOKEN }} | |
| # publish_dir: ./site |