Skip to content

Commit 52d7eb9

Browse files
committed
CI: Doc cleanup should clear main as well as previews
1 parent cd433d8 commit 52d7eb9

File tree

7 files changed

+802
-961
lines changed

7 files changed

+802
-961
lines changed

.github/workflows/doc-clean.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,36 @@ jobs:
2020
uses: actions/checkout@v4
2121
with:
2222
ref: gh-pages
23-
- name: Delete preview and history + push changes
23+
fetch-depth: 0 # Fetch full history to enable orphan branch creation
24+
25+
- name: Configure Git
2426
run: |
25-
git config user.name "Documenter.jl"
26-
git config user.email "[email protected]"
27+
git config user.name "Documenter.jl"
28+
git config user.email "[email protected]"
29+
30+
- name: Delete preview directory (if exists)
31+
run: |
32+
if [ -d "${preview_dir}" ]; then
2733
git rm -rf "${preview_dir}"
28-
git commit -m "delete preview"
29-
git branch gh-pages-new "$(echo "delete history" | git commit-tree "HEAD^{tree}")"
30-
git push --force origin gh-pages-new:gh-pages
34+
git commit -m "delete preview for closed PR" || echo "No preview to delete"
35+
else
36+
echo "No preview directory found to delete"
37+
fi
38+
env:
39+
preview_dir: ${{ format('previews/PR{0}', github.event.pull_request.number) }}
40+
41+
- name: Create new orphan branch with current state
42+
run: |
43+
# Create a new orphan branch to remove all history
44+
git checkout --orphan gh-pages-temp
45+
46+
# Add all current files to the new branch
47+
git add -A
48+
git commit -m "Reset gh-pages history - keep only latest state"
49+
50+
# Force push the new branch to replace gh-pages
51+
git push --force origin gh-pages-temp:gh-pages
52+
53+
# Clean up the temporary branch
54+
git checkout gh-pages
55+
git branch -D gh-pages-temp

Project.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
name = "PlanetOrbits"
22
uuid = "fd6f9641-d78f-43ce-a379-ceb0bddb468a"
3-
authors = ["William Thompson <[email protected]>", "Jensen Lawrence"]
43
version = "0.11.0"
4+
authors = ["William Thompson <[email protected]>", "Jensen Lawrence"]
55

66
[deps]
77
AstroTime = "c61b5328-d09d-5e37-a9a8-0eb41c39009c"
88
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
99
CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298"
1010
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
1111
DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"
12+
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
13+
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1214
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1315
NamedTupleTools = "d9ec5142-1e00-5aa0-9d6a-321866360f50"
1416
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
@@ -20,8 +22,6 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2022
[weakdeps]
2123
DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"
2224
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
23-
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
24-
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
2525
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
2626

2727
[extensions]
@@ -36,13 +36,12 @@ CoordinateTransformations = "0.6"
3636
DiffRules = "1"
3737
Enzyme = "0.11, 0.12, 0.13"
3838
ForwardDiff = "0.10"
39-
julia = "^1.9"
4039
NamedTupleTools = "0.13, 0.14"
4140
PrecompileTools = "1.1.2"
4241
RecipesBase = "1.2"
43-
StaticArrays = "1.3"
4442
Roots = "2.1"
45-
43+
StaticArrays = "1.3"
44+
julia = "^1.9"
4645

4746
[extras]
4847
DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"

0 commit comments

Comments
 (0)