Skip to content

Commit

Permalink
fix(ci): patch release
Browse files Browse the repository at this point in the history
  • Loading branch information
jaygridley committed Nov 11, 2024
1 parent 3ece962 commit a936c71
Showing 1 changed file with 13 additions and 48 deletions.
61 changes: 13 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Release Charts
name: Release

on:
workflow_dispatch:
push:
branches:
- main
release:
types: [published]
tags:
- 'v*'

permissions:
contents: write
Expand Down Expand Up @@ -36,11 +35,14 @@ jobs:
with:
version: ${{ env.HELM_VERSION }}

- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: true
- name: Publish Helm chart
uses: bsord/helm-push@v4
with:
useOCIRegistry: true
registry-url: oci://ghcr.io/${{ github.repository }}
username: ${{ github.repository_owner }}
access-token: ${{ secrets.GITHUB_TOKEN }}
chart-folder: charts/${{ github.repository }}

binary:
runs-on: ubuntu-22.04
Expand All @@ -54,7 +56,6 @@ jobs:
uses: actions/setup-go@v5

- name: Run GoReleaser
if: startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
Expand All @@ -63,16 +64,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser snapshot
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

image:
runs-on: ubuntu-22.04
steps:
Expand All @@ -93,39 +84,13 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta for latest
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/lablabs/aws-service-quotas-exporter
tags: |
type=raw,value=latest
- name: Build image and push to GitHub Container Registry
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true

- name: Docker meta for tag
if: startsWith(github.ref, 'refs/tags/')
id: meta-tag
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/lablabs/aws-service-quotas-exporter
tags: |
type=raw,value=${{ github.ref_name }}
images: ghcr.io/lablabs/aws-service-quotas-exporter

- name: Build image and push to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: .
Expand Down

0 comments on commit a936c71

Please sign in to comment.