Add CR_SKIP_EXISTING env var, replace release dir creation with file … #5
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
name: Helm | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- 'charts/**' | |
workflow_dispatch: {} | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
helm-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set Version | |
run: | | |
TAG=$(git describe --tags --abbrev=0) | |
sed -ie "s/appVersion: \"latest\"/appVersion: ${TAG}/g" ./charts/node-ipam-controller/Chart.yaml | |
sed -ie "s/version: 0.0.0/version: ${TAG}/g" ./charts/node-ipam-controller/Chart.yaml | |
- name: Set up Helm | |
uses: azure/setup-helm@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
check-latest: true | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@v2.6.1 | |
- name: Run chart-testing (lint) | |
run: ct lint --check-version-increment=false --chart-dirs charts --target-branch ${{ github.event.repository.default_branch }} | |
helm-release: | |
needs: helm-test | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: Set up Helm | |
uses: azure/setup-helm@v4 | |
- name: Set Version | |
run: | | |
TAG=$(git describe --tags --abbrev=0) | |
sed -ie "s/appVersion: \"latest\"/appVersion: ${TAG}/g" ./charts/node-ipam-controller/Chart.yaml | |
sed -ie "s/version: 0.0.0/version: ${TAG}/g" ./charts/node-ipam-controller/Chart.yaml | |
- name: Run chart-releaser | |
uses: helm/chart-releaser-action@v1.6.0 | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
CR_SKIP_EXISTING: "true" | |
with: | |
charts_dir: charts | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: List files | |
run: | | |
ls -la | |
ls -la .cr-* || true | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: '.cr-index' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |