|
59 | 59 | - uses: actions/checkout@v4.1.7
|
60 | 60 | with:
|
61 | 61 | submodules: 'true'
|
| 62 | + fetch-depth: 0 |
62 | 63 | - name: Install poetry
|
63 | 64 | run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
|
64 | 65 | - uses: actions/setup-python@v5.1.0
|
@@ -94,18 +95,26 @@ jobs:
|
94 | 95 | yarn install --frozen-lockfile
|
95 | 96 | yarn build
|
96 | 97 | cp -r ../build/html build/api
|
97 |
| - - name: Fetch existing gh-pages branch |
| 98 | + - name: Prepare github_pages branch |
98 | 99 | run: |
|
99 |
| - git fetch origin github_pages:github_pages |
100 |
| - git checkout github_pages || git checkout -b github_pages |
101 |
| - mkdir -p docs/cyclops-webpage/build/api |
| 100 | + git config --global user.name 'GitHub Actions' |
| 101 | + git config --global user.email 'actions@github.com' |
| 102 | + git fetch origin github_pages:github_pages || git checkout --orphan github_pages |
| 103 | + git checkout github_pages |
| 104 | + git rm -rf . |
| 105 | + git clean -fxd |
| 106 | + - name: Copy built files |
| 107 | + run: | |
| 108 | + cp -R docs/cyclops-webpage/build/* . |
102 | 109 | if [[ "${{ needs.check_release.outputs.is_release }}" != "true" ]]; then
|
| 110 | + mkdir -p docs/cyclops-webpage/build/api |
103 | 111 | git checkout github_pages -- docs/cyclops-webpage/build/api/*.html || true
|
104 | 112 | fi
|
105 |
| - git checkout ${{ github.sha }} |
106 |
| - - name: Copy built files |
| 113 | + - name: Commit and push to github_pages |
107 | 114 | run: |
|
108 |
| - cp -R docs/cyclops-webpage/build/* . |
| 115 | + git add . |
| 116 | + git commit -m "Update documentation" || echo "No changes to commit" |
| 117 | + git push -f origin github_pages |
109 | 118 | - name: Deploy to GitHub Pages
|
110 | 119 | uses: peaceiris/actions-gh-pages@v4.0.0
|
111 | 120 | with:
|
|
0 commit comments