-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Deploy docs as a static website
- Loading branch information
Showing
28 changed files
with
707 additions
and
414 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,92 @@ | ||
# Sample workflow for building and deploying a Hugo site to GitHub Pages | ||
name: Deploy Hugo site to Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
# https://github.com/gohugoio/hugo/releases | ||
HUGO_VERSION: 0.120.4 | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Set up Hugo CLI | ||
run: | | ||
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_linux-amd64.deb \ | ||
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb | ||
- name: Set up Dart Sass | ||
run: sudo snap install dart-sass | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4.1.1 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Setup Pages | ||
id: pages | ||
uses: actions/configure-pages@v3.0.6 | ||
|
||
- name: Build with Hugo | ||
working-directory: docs | ||
env: | ||
# For maximum backward compatibility with Hugo modules | ||
HUGO_ENVIRONMENT: production | ||
HUGO_ENV: production | ||
run: | | ||
hugo \ | ||
--gc \ | ||
--minify \ | ||
--baseURL "${{ steps.pages.outputs.base_url }}/" | ||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v3.1.3 | ||
with: | ||
name: hugo | ||
path: public | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
runs-on: ubuntu-22.04 | ||
needs: build | ||
steps: | ||
- name: Pull from gh-pages | ||
uses: actions/checkout@v4.1.1 | ||
with: | ||
ref: gh-pages | ||
|
||
- name: Clean previous Hugo build | ||
run: | | ||
# Clean all except Helm index | ||
find . -type f -not -name "index.yaml" -delete | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v3.0.2 | ||
with: | ||
name: hugo | ||
|
||
- name: Commit and push | ||
run: | | ||
# Configure git | ||
git config --global user.name "${{ github.actor }}" | ||
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
# Commit and push | ||
git add . | ||
git commit -m "Deploy hugo site" | ||
git push origin gh-pages |
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
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "cicd/version"] | ||
path = cicd/version | ||
url = https://github.com/clemlesne/gitops-version | ||
[submodule "docs/themes/hextra"] | ||
path = docs/themes/hextra | ||
url = https://github.com/imfing/hextra.git |
Oops, something went wrong.