PKG #66
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
# --------------------------------------------------------------------------------------- | |
# Title: Continuous Delivery (Packaging) | |
# | |
# Requirements: | |
# - Create manually "gh-pages" branch | |
# - Maintain pages files in "gh-pages" branch: index.tpl, placeholder.png | |
# | |
# Uses: | |
# - https://github.com/helm/chart-releaser-action | |
# - https://github.com/halkeye/helm-repo-html | |
# --------------------------------------------------------------------------------------- | |
name: PKG | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout git repository | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: 3.10.1 | |
- name: Add dependency chart repositories | |
run: ./scripts/add_helm_repo.sh | |
- name: Host charts repository on GitHub Pages | |
uses: helm/[email protected] | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
# important: it needs to be done in the same pipeline as another pages workflow won't be triggered by the pust on the gh-pages branch | |
# (tried with a PAT and several options but didn't work) | |
- name: Checkout gh-pages branch | |
uses: actions/[email protected] | |
with: | |
ref: gh-pages | |
- name: Setup Go environment | |
uses: actions/[email protected] | |
- name: Generate index.html | |
run: | | |
go install github.com/halkeye/[email protected] | |
/home/runner/go/bin/helm-repo-html | |
- name: Setup Pages | |
uses: actions/configure-pages@v1 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |