(helm)update image #3
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: [ 'v*' ] | |
env: | |
PLATFORMS: "linux darwin windows" | |
ARCH: "amd64 arm64" | |
jobs: | |
docker: | |
name: Release docker image | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
helm: | |
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" | |
git config --global --add safe.directory /charts | |
- name: Copy LICENSE for packaging | |
run: | | |
cp ./LICENSE ./charts/whodidthat/LICENSE | |
- name: Get chart version | |
id: chart_version | |
run: | | |
echo "CHART_VERSION=$(cat ./charts/whodidthat/Chart.yaml | awk -F"[ ',]+" '/version:/{print $2}' | head -n 1)" >> $GITHUB_OUTPUT | |
- name: Check if tag exists | |
id: tag_exists | |
run: | | |
TAG_EXISTS=false | |
if git tag -l | grep "${{ env.crds_tag_prefix }}${{ steps.chart_version.outputs.CHART_VERSION }}" > /dev/null ; then | |
TAG_EXISTS=true | |
fi | |
echo TAG_EXISTS=$TAG_EXISTS >> $GITHUB_OUTPUT | |
- name: Publish Helm chart to the ghcr.io registry | |
uses: appany/helm-oci-chart-releaser@v0.4.2 | |
with: | |
name: whodidthat | |
repository: x0ddf | |
tag: ${{ steps.chart_version.outputs.CHART_VERSION }} | |
registry: ghcr.io | |
registry_username: ${{ github.actor }} | |
registry_password: ${{ secrets.GITHUB_TOKEN }} |