|
21 | 21 | fetch-depth: 0 # Fetch all history for branch switching |
22 | 22 | submodules: true |
23 | 23 |
|
24 | | - - name: Setup Graphviz |
25 | | - uses: ts-graphviz/setup-graphviz@v1 |
26 | | - |
27 | 24 | - name: Set up Python 3.10 |
28 | 25 | uses: actions/setup-python@v4 |
29 | 26 | with: |
|
32 | 29 | - name: Install system dependencies |
33 | 30 | run: | |
34 | 31 | sudo apt-get update |
35 | | - sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev |
| 32 | + sudo apt-get install -y graphviz libsasl2-dev libldap2-dev libssl-dev |
36 | 33 |
|
37 | 34 | # ============================================ |
38 | 35 | # BUILD v1.3 (from stable branch) |
@@ -151,17 +148,47 @@ jobs: |
151 | 148 | # DEPLOY TO CF-PAGES |
152 | 149 | # ============================================ |
153 | 150 | - name: Deploy to cf-pages branch |
154 | | - uses: peaceiris/actions-gh-pages@v3 |
155 | | - with: |
156 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
157 | | - publish_dir: _build/html |
158 | | - publish_branch: cf-pages |
159 | | - keep_files: true # Preserve preview deployments |
| 151 | + run: | |
| 152 | + set -e |
| 153 | +
|
| 154 | + # Configure git |
| 155 | + git config user.name "github-actions[bot]" |
| 156 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 157 | +
|
| 158 | + # Create a temporary directory for the deployment |
| 159 | + DEPLOY_DIR=$(mktemp -d) |
| 160 | + cp -r _build/html/* "$DEPLOY_DIR/" |
| 161 | +
|
| 162 | + # Fetch cf-pages branch |
| 163 | + git fetch origin cf-pages:cf-pages || git checkout --orphan cf-pages |
| 164 | + git checkout cf-pages |
| 165 | +
|
| 166 | + # Preserve preview deployments (keep_files equivalent) |
| 167 | + if [ -d "previews" ]; then |
| 168 | + cp -r previews "$DEPLOY_DIR/" |
| 169 | + fi |
| 170 | +
|
| 171 | + # Clean current content except .git |
| 172 | + find . -maxdepth 1 ! -name '.git' ! -name '.' -exec rm -rf {} + |
| 173 | +
|
| 174 | + # Copy new content |
| 175 | + cp -r "$DEPLOY_DIR"/* . |
| 176 | +
|
| 177 | + # Add .nojekyll to prevent Jekyll processing |
| 178 | + touch .nojekyll |
| 179 | +
|
| 180 | + # Commit and push |
| 181 | + git add -A |
| 182 | + git commit -m "Deploy multi-version documentation (v2.0 + v1.3)" || echo "No changes to commit" |
| 183 | + git push origin cf-pages |
| 184 | +
|
| 185 | + # Clean up |
| 186 | + rm -rf "$DEPLOY_DIR" |
160 | 187 |
|
161 | 188 | - name: Display deployment status |
162 | 189 | run: | |
163 | 190 | echo "============================================" |
164 | | - echo "✅ Multi-version documentation deployed!" |
| 191 | + echo "Multi-version documentation deployed!" |
165 | 192 | echo "============================================" |
166 | 193 | echo "" |
167 | 194 | echo "URLs:" |
|
0 commit comments