Skip to content

Commit

Permalink
Merge branch 'feat/static-website' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Nov 25, 2023
2 parents 2a02ac7 + 34ab3d9 commit 83d6b75
Show file tree
Hide file tree
Showing 28 changed files with 696 additions and 414 deletions.
85 changes: 83 additions & 2 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ env:
HADOLINT_VERSION: 2.12.0
# https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
VS_BUILDTOOLS_WIN_VERSION: 17
# https://github.com/gohugoio/hugo/releases
HUGO_VERSION: 0.120.4

jobs:
sast-creds:
Expand Down Expand Up @@ -227,6 +229,7 @@ jobs:
skip_packaging: true
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_SKIP_EXISTING: true # Avoid overriding existing files, compat with the Hugo static site

test:
name: Test
Expand Down Expand Up @@ -362,7 +365,7 @@ jobs:
io.artifacthub.package.category=integration-delivery
io.artifacthub.package.keywords=agent,azure,azure-devops,azure-pipelines,container,devops,docker,helm,kubernetes,pipelines,self-hosted,self-hosted-agent,auto-scale,keda
io.artifacthub.package.license=Apache-2.0
io.artifacthub.package.logo-url=https://raw.githubusercontent.com/${{ env.CONTAINER_NAME }}/${{ github.sha }}/logo-1024.png
io.artifacthub.package.logo-url=https://raw.githubusercontent.com/${{ env.CONTAINER_NAME }}/${{ github.sha }}/docs/static/images/logo-1024.png
io.artifacthub.package.maintainers=[{"name":"${{ github.actor }}","email":"${{ github.actor }}@users.noreply.github.com"}]
io.artifacthub.package.prerelease=${{ steps.prerelease.outputs.prerelease }}
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ env.CONTAINER_NAME }}/${{ github.sha }}/README.md
Expand Down Expand Up @@ -537,7 +540,7 @@ jobs:
io.artifacthub.package.category=integration-delivery
io.artifacthub.package.keywords=agent,azure,azure-devops,azure-pipelines,container,devops,docker,helm,kubernetes,pipelines,self-hosted,self-hosted-agent,auto-scale,keda
io.artifacthub.package.license=Apache-2.0
io.artifacthub.package.logo-url=https://raw.githubusercontent.com/${{ env.CONTAINER_NAME }}/${{ github.sha }}/logo-1024.png
io.artifacthub.package.logo-url=https://raw.githubusercontent.com/${{ env.CONTAINER_NAME }}/${{ github.sha }}/docs/static/images/logo-1024.png
io.artifacthub.package.maintainers=[{"name":"${{ github.actor }}","email":"${{ github.actor }}@users.noreply.github.com"}]
io.artifacthub.package.prerelease=${{ steps.prerelease.outputs.prerelease }}
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ env.CONTAINER_NAME }}/${{ github.sha }}/README.md
Expand Down Expand Up @@ -707,3 +710,81 @@ jobs:
${{ env.CONTAINER_REGISTRY_DOCKER_HUB }}/${{ env.CONTAINER_NAME }}:artifacthub.io \
artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml \
--config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml
build-hugo:
name: Build Hugo site
runs-on: ubuntu-22.04
needs:
- sast-creds
- sast-semgrep
- test
steps:
- name: Setup 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: Setup 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: docs/public

deploy-hugo:
name: Deploy Hugo site
needs:
- build-hugo
# Only deploy on non-scheduled main branch, as there is only one Helm repo and we cannot override an existing version
if: (github.event_name != 'schedule') && (github.ref == 'refs/heads/main')
runs-on: ubuntu-22.04
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" -not -path "*/.git/*" -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
3 changes: 3 additions & 0 deletions .gitmodules
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
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cicd/version
docs/themes/hextra
src/helm/azure-pipelines-agent/templates
Loading

0 comments on commit 83d6b75

Please sign in to comment.