Skip to content

Commit 83c88d9

Browse files
committed
push gh-pages-staging
1 parent 3956b2b commit 83c88d9

File tree

1 file changed

+24
-38
lines changed

1 file changed

+24
-38
lines changed

.github/workflows/update-docs-staging.yml

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
# 1. Checkout doc branch
1717
- name: Checkout current branch
1818
uses: actions/checkout@v4
19+
with:
20+
path: java-driver
1921

2022
# 2. Java 8
2123
- name: Set up Java 8
@@ -64,41 +66,25 @@ jobs:
6466
ref: gh-pages-staging
6567
path: gh-pages-staging
6668

67-
# 7. Replace content in gh-pages branch
68-
# - name: Sync docs into gh-pages
69-
# run: |
70-
# cd gh-pages
71-
# find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
72-
# cd ..
73-
# cp -R doc/docs/* gh-pages/
74-
#
75-
# # 8. Commit changes to g]h-pages
76-
# - name: Commit and push to gh-pages
77-
# working-directory: gh-pages
78-
# run: |
79-
# git config user.name "github-actions[bot]"
80-
# git config user.email "github-actions[bot]@users.noreply.github.com"
81-
#
82-
# git add .
83-
#
84-
# if git diff --cached --quiet; then
85-
# echo "No changes to push to gh-pages."
86-
# exit 0
87-
# fi
88-
#
89-
# git commit -m "Update generated docs"
90-
# git push origin gh-pages
91-
#
92-
# # 9. Create or update PR: gh-pages-pr -> gh-pages
93-
# - name: Create or update gh-pages PR
94-
# uses: peter-evans/create-pull-request@v7
95-
# with:
96-
# token: ${{ secrets.GITHUB_TOKEN }}
97-
# path: gh-pages
98-
# branch: gh-pages-pr
99-
# base: gh-pages
100-
# commit-message: "Update generated docs"
101-
# title: "Update generated docs on gh-pages"
102-
# body: |
103-
# This PR updates the `gh-pages` branch with the latest generated documentation.
104-
# A downloadable ZIP of the built docs is also available in the workflow artifacts.
69+
- name: Copy and Build Doc
70+
working-directory: gh-pages-staging
71+
run: |
72+
cp -r ../java-driver/docs ./docs/latest
73+
mkdocs build
74+
cp -r ./out/ . # because the index.html has to be in the root folder
75+
76+
- name: Commit and push to gh-pages-staging
77+
working-directory: gh-pages-staging
78+
run: |
79+
git config --global user.email "gha@cassandra.apache.org"
80+
git config --global user.name "GHA for Apache Cassandra Website"
81+
82+
git add .
83+
84+
if git diff --cached --quiet; then
85+
echo "No changes to push to gh-pages."
86+
exit 0
87+
fi
88+
89+
git commit -m "Update generated docs"
90+
git push origin gh-pages

0 commit comments

Comments
 (0)