Skip to content

Commit f6b3ed6

Browse files
committed
Push rendered HTML content to gh-pages for quarkus.search.io consumption
1 parent 12f889c commit f6b3ed6

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
permissions:
16+
contents: write
1617
pages: write
1718
id-token: write
1819

@@ -52,3 +53,22 @@ jobs:
5253
- name: Deploy to GitHub Pages
5354
id: deploy
5455
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
56+
57+
# search.quarkus.io expects that the rendered content is available in gh-pages branch
58+
- name: Sync gh-pages branch
59+
run: |
60+
SITE_DIR=$(mktemp -d)
61+
rsync -a ./_site/ "$SITE_DIR"
62+
63+
git config --local user.email "action@github.com"
64+
git config --local user.name "GitHub Action"
65+
66+
git fetch origin gh-pages:gh-pages
67+
git checkout gh-pages
68+
69+
rsync -a --delete --exclude='.git' --exclude='.nojekyll' "$SITE_DIR"/ .
70+
git add -A
71+
git rm -rf --cached --ignore-unmatch _site
72+
73+
git commit --allow-empty -m "deploy: ${{ github.sha }}"
74+
git push origin gh-pages

0 commit comments

Comments
 (0)