Skip to content

Commit e3ceb3c

Browse files
committed
ci: new update CI draft
1 parent f2d95b0 commit e3ceb3c

File tree

2 files changed

+33
-136
lines changed

2 files changed

+33
-136
lines changed

.github/workflows/refresh_dev_docs.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/update_docs.yml

Lines changed: 33 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,49 @@
1-
name: Update Documentation
1+
name: Sync libdebug gh-pages into main
22

33
on:
4-
repository_dispatch:
5-
types: ["update_docs"]
4+
push:
5+
branches:
6+
- main
67

78
jobs:
8-
build:
9+
sync:
910
runs-on: ubuntu-latest
1011
permissions:
1112
contents: write
1213

1314
steps:
14-
- name: Set up Python
15-
uses: actions/setup-python@v5
16-
with:
17-
python-version: 3.12
18-
19-
- name: Install documentation dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
python -m pip install --upgrade setuptools
23-
python -m pip install --upgrade Sphinx
24-
python -m pip install --upgrade pydata-sphinx-theme
25-
python -m pip install --upgrade sphinx_code_tabs
26-
27-
- name: Install libdebug dependencies
28-
run: |
29-
sudo apt-get update
30-
sudo apt-get install -y --no-install-recommends libdwarf-dev libelf-dev libiberty-dev linux-headers-generic libc6-dbg
31-
32-
- name: Checkout libdebug
15+
- name: Checkout this repo
3316
uses: actions/checkout@v4
3417
with:
35-
repository: 'libdebug/libdebug'
36-
path: 'libdebug'
37-
ref: ${{ github.event.client_payload.sha }}
18+
fetch-depth: 0
3819

39-
- name: Install libdebug
40-
run: |
41-
cd libdebug
42-
python -m pip install --upgrade .
43-
44-
- name: Build documentation
45-
run: |
46-
cd libdebug/docs
47-
./regenerate_docs.sh
48-
rm -r build/html/_static/__pycache__
49-
50-
- name: Checkout docs
20+
- name: Checkout libdebug gh-pages
5121
uses: actions/checkout@v4
5222
with:
53-
path: 'docs'
23+
repository: libdebug/libdebug
24+
ref: gh-pages
25+
path: libdebug-pages
26+
fetch-depth: 1
5427

55-
- name: Update files and commit changes
28+
- name: Sync files from gh-pages
5629
run: |
57-
cd libdebug
58-
export LIBDEBUG_VERSION=$(python -m setup --version 2>/dev/null)
59-
cd ..
60-
export OLD_VERSION=$(cat docs/latest/version)
61-
echo "Removing docs/archive/$OLD_VERSION"
62-
rm -rf "docs/archive/$OLD_VERSION"
63-
mv docs/latest "docs/archive/$OLD_VERSION"
64-
mv libdebug/docs/build/html docs/latest
65-
echo $LIBDEBUG_VERSION > docs/latest/version
66-
cd docs
67-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
68-
git config --local user.name "github-actions[bot]"
69-
git tag -f $LIBDEBUG_VERSION
70-
git add archive/$OLD_VERSION
71-
git commit -a -m "Autorefresh Documentation"
72-
73-
- name: Push changes
74-
uses: ad-m/github-push-action@master
75-
with:
76-
directory: 'docs'
77-
force: true
78-
tags: true
30+
# copy all files over, but leave existing files intact and skip any .git dirs
31+
rsync -av libdebug-pages/ . \
32+
--exclude '.github/**' \
33+
--exclude '.git' \
34+
--exclude '.git/**'
35+
36+
- name: Commit & push changes
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
run: |
40+
git config user.name "github-actions[bot]"
41+
git config user.email "github-actions[bot]@users.noreply.github.com"
42+
43+
if git diff --quiet; then
44+
echo "✅ Nothing to commit."
45+
else
46+
git add --all
47+
git commit -m "chore: sync content from libdebug/libdebug@gh-pages"
48+
git push origin main
49+
fi

0 commit comments

Comments
 (0)