Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Nov 27, 2023
2 parents d4f256c + a56ad33 commit 231cc30
Show file tree
Hide file tree
Showing 35 changed files with 2,370 additions and 416 deletions.
93 changes: 87 additions & 6 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 @@ -189,7 +191,7 @@ jobs:
snyk.sarif
- name: Upload results to GitHub Security
uses: github/codeql-action/upload-sarif@v2.22.7
uses: github/codeql-action/upload-sarif@v2.22.8
with:
sarif_file: merged.sarif

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/favicon.svg
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 @@ -443,7 +446,7 @@ jobs:
*.sarif
- name: Upload results to GitHub Security
uses: github/codeql-action/upload-sarif@v2.22.7
uses: github/codeql-action/upload-sarif@v2.22.8
with:
sarif_file: merged.sarif

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/favicon.svg
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 @@ -643,7 +646,7 @@ jobs:
${{ steps.tag.outputs.tag }}
- name: Upload results to GitHub Security
uses: github/codeql-action/upload-sarif@v2.22.7
uses: github/codeql-action/upload-sarif@v2.22.8
with:
sarif_file: snyk.sarif

Expand All @@ -664,7 +667,7 @@ jobs:
run: semgrep ci --sarif --output=semgrep.sarif

- name: Upload results to GitHub Security
uses: github/codeql-action/upload-sarif@v2.22.7
uses: github/codeql-action/upload-sarif@v2.22.8
with:
sarif_file: semgrep.sarif

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
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: test lint build-docker
.PHONY: test lint build-docker docs build-docs

test:
@echo "➡️ Running Prettier..."
Expand All @@ -14,5 +14,11 @@ lint:
@echo "➡️ Running Hadolint..."
find . -name "Dockerfile*" -exec bash -c "echo 'File {}:' && hadolint {}" \;

docs:
cd docs && hugo server

build-docker:
bash cicd/docker-build-local.sh

build-docs:
cd docs && hugo --gc --minify
Loading

0 comments on commit 231cc30

Please sign in to comment.