|
16 | 16 | # 1. Checkout doc branch |
17 | 17 | - name: Checkout current branch |
18 | 18 | uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + path: java-driver |
19 | 21 |
|
20 | 22 | # 2. Java 8 |
21 | 23 | - name: Set up Java 8 |
@@ -64,41 +66,25 @@ jobs: |
64 | 66 | ref: gh-pages-staging |
65 | 67 | path: gh-pages-staging |
66 | 68 |
|
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