Skip to content

Commit 5deca22

Browse files
committed
fix: use GitHub-owned actions instead of blocked third-party actions
- Remove ts-graphviz/setup-graphviz@v1, install graphviz via apt-get - Replace peaceiris/actions-gh-pages@v3 with git commands - Preserves preview deployments when deploying to cf-pages branch
1 parent 58689db commit 5deca22

1 file changed

Lines changed: 38 additions & 11 deletions

File tree

.github/workflows/build_deploy_multiversion.yml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ jobs:
2121
fetch-depth: 0 # Fetch all history for branch switching
2222
submodules: true
2323

24-
- name: Setup Graphviz
25-
uses: ts-graphviz/setup-graphviz@v1
26-
2724
- name: Set up Python 3.10
2825
uses: actions/setup-python@v4
2926
with:
@@ -32,7 +29,7 @@ jobs:
3229
- name: Install system dependencies
3330
run: |
3431
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
3633
3734
# ============================================
3835
# BUILD v1.3 (from stable branch)
@@ -151,17 +148,47 @@ jobs:
151148
# DEPLOY TO CF-PAGES
152149
# ============================================
153150
- 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"
160187
161188
- name: Display deployment status
162189
run: |
163190
echo "============================================"
164-
echo "Multi-version documentation deployed!"
191+
echo "Multi-version documentation deployed!"
165192
echo "============================================"
166193
echo ""
167194
echo "URLs:"

0 commit comments

Comments
 (0)