fix(ci): rm flag --charts-repo from cr #24
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: Workflow | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
Job: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: [3.8] | |
helm-version: [v3.4.0] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Configure Git | |
run: | | |
git config user.name "${GITHUB_REPOSITORY_OWNER}" | |
git config user.email "${GITHUB_REPOSITORY_OWNER}@users.noreply.github.com" | |
- name: Fetch History | |
run: git fetch --prune --unshallow | |
- uses: FranzDiebold/github-env-vars-action@v2 | |
- name: Install Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Helm | |
uses: azure/setup-helm@v1 | |
with: | |
version: ${{ matrix.helm-version }} | |
- name: Add Bitnami Repo | |
run: helm repo add bitnami https://charts.bitnami.com/bitnami | |
- name: Set up chart-testing | |
uses: helm/[email protected] | |
- name: Run chart-testing (lint) | |
run: ct lint --chart-dirs chart --target-branch main --all | |
- name: Install chart-releaser | |
run: | | |
sudo curl -sLo /tmp/cr \ | |
https://github.com/helm/chart-releaser/releases/download/v1.6.1/chart-releaser_1.6.1_linux_amd64.tar.gz | |
sudo tar xvf /tmp/cr cr | |
sudo chmod +x /tmp/cr | |
mv cr /usr/local/bin/cr | |
cr version | |
- name: Install yq | |
run: | | |
sudo curl -sLo /usr/local/bin/yq \ | |
https://github.com/mikefarah/yq/releases/download/v4.3.2/yq_linux_amd64 && \ | |
sudo chmod +x /usr/local/bin/yq | |
yq -V | |
- name: Conventional Changelog Action | |
id: changelog | |
uses: TriPSs/conventional-changelog-action@v3 | |
with: | |
github-token: ${{ secrets.github_token }} | |
pre-commit: preCommit.js | |
version-file: ./chart/lambda/Chart.yaml | |
version-path: version | |
release-count: 0 | |
git-user-name: ${{ github.repository_owner }} | |
git-user-email: "${{ github.repository_owner }}@users.noreply.github.com" | |
- name: Create Package | |
run: cr package chart/lambda/ --package-path ./ | |
- name: Release | |
if: ${{ steps.changelog.outputs.tag }} | |
env: | |
TAG: ${{ steps.changelog.outputs.tag }} | |
MSG: ${{ steps.changelog.outputs.clean_changelog }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
sudo apt-get update && sudo apt-get install -yq hub | |
set -x | |
assets=() | |
for asset in lambda-*.tgz; do | |
assets+=("-a" "$asset") | |
done | |
echo -e "$TAG\n\n$MSG" | hub release create "${assets[@]}" -F- "$TAG" | |
- name: Update Index.yaml | |
run: | | |
cr index \ | |
--owner "${GITHUB_REPOSITORY_OWNER}" \ | |
--git-repo "${CI_REPOSITORY_NAME}" \ | |
--token "${GITHUB_TOKEN}" \ | |
--release-name-template "v{{ .Version }}" \ | |
--push \ | |
--package-path ./ \ | |
-i index.yaml | |
if: ${{ steps.changelog.outputs.tag }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
if: ${{ steps.changelog.outputs.tag }} | |
- name: Log into GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR }} | |
if: ${{ steps.changelog.outputs.tag }} | |
- name: Build and Push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/${{ env.CI_REPOSITORY_OWNER_SLUG }}/${{ env.CI_REPOSITORY_NAME_SLUG }}:${{ steps.changelog.outputs.tag }} | |
ghcr.io/${{ env.CI_REPOSITORY_OWNER_SLUG }}/${{ env.CI_REPOSITORY_NAME_SLUG }}:latest | |
if: ${{ steps.changelog.outputs.tag }} |