-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github: Add deploy action for gh-pages
This action will build the docs and deploy them to the `gh-pages` branch on push to the `master` branch. Github Pages will pickup and host the docs from the `gh-pages` branch. Signed-off-by: Dylan Reimerink <[email protected]>
- Loading branch information
1 parent
1586e59
commit 6ff82c4
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Deploy GH pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
USER: root | ||
|
||
jobs: | ||
deploy-gh-pages: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Cache Primes | ||
id: cache-plugins | ||
uses: actions/cache@v4 | ||
with: | ||
path: .cache | ||
key: cache-plugins | ||
- name: Checkout gh-pages branch | ||
run: | | ||
git branch --delete --force gh-pages || true | ||
git checkout -b gh-pages | ||
- name: Apply deploy config | ||
run: | | ||
echo "" >> mkdocs.yml | ||
echo "site_url: https://isovalent.github.io" >> mkdocs.yml | ||
echo "" >> mkdocs.yml | ||
echo "extra:" >> mkdocs.yml | ||
echo " analytics:" >> mkdocs.yml | ||
echo " provider: google" >> mkdocs.yml | ||
echo " property: G-KVJ1CK539N" >> mkdocs.yml | ||
- name: Build html | ||
run: | | ||
make html PROD=true GH_TOKEN=${{ secrets.GITHUB_TOKEN }} | ||
- name: Deploy to gh-pages | ||
run: | | ||
rm out/.gitignore || true | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GH Deploy Action" | ||
git add -f out/. | ||
git commit -m "Deploy to gh-pages" | ||
git push -f --set-upstream origin gh-pages | ||