diff --git a/.github/workflows/build-container.yaml b/.github/workflows/build-container.yaml index 44d8c7e..dfd67b8 100644 --- a/.github/workflows/build-container.yaml +++ b/.github/workflows/build-container.yaml @@ -1,11 +1,10 @@ name: Build Docker Image on: - release: - types: [created] push: branches: - main + pull_request: {} workflow_dispatch: jobs: @@ -57,30 +56,3 @@ jobs: platforms: | linux/amd64 linux/arm64 - - - build-helm-chart: - name: Build Helm chart - permissions: - contents: write - 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: Install Helm - uses: azure/setup-helm@v4 - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.6.0 - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..cdd03a8 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,80 @@ +name: Build Release Docker Image + +on: + push: + tags: + - 'v*' + +jobs: + + build-container-image: + name: Build container image + runs-on: ubuntu-latest + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + + permissions: + contents: read + packages: write + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" + tags: | + type=semver + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: | + linux/amd64 + linux/arm64 + + + build-helm-chart: + name: Build Helm chart + permissions: + contents: write + 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: Install Helm + uses: azure/setup-helm@v4 + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/charts/radix-oauth-guard/.helmignore b/charts/radix-prometheus-proxy/.helmignore similarity index 100% rename from charts/radix-oauth-guard/.helmignore rename to charts/radix-prometheus-proxy/.helmignore diff --git a/charts/radix-oauth-guard/Chart.yaml b/charts/radix-prometheus-proxy/Chart.yaml similarity index 100% rename from charts/radix-oauth-guard/Chart.yaml rename to charts/radix-prometheus-proxy/Chart.yaml diff --git a/charts/radix-oauth-guard/templates/_helpers.tpl b/charts/radix-prometheus-proxy/templates/_helpers.tpl similarity index 100% rename from charts/radix-oauth-guard/templates/_helpers.tpl rename to charts/radix-prometheus-proxy/templates/_helpers.tpl diff --git a/charts/radix-oauth-guard/templates/deployment.yaml b/charts/radix-prometheus-proxy/templates/deployment.yaml similarity index 100% rename from charts/radix-oauth-guard/templates/deployment.yaml rename to charts/radix-prometheus-proxy/templates/deployment.yaml diff --git a/charts/radix-oauth-guard/templates/service.yaml b/charts/radix-prometheus-proxy/templates/service.yaml similarity index 100% rename from charts/radix-oauth-guard/templates/service.yaml rename to charts/radix-prometheus-proxy/templates/service.yaml diff --git a/charts/radix-oauth-guard/values.yaml b/charts/radix-prometheus-proxy/values.yaml similarity index 100% rename from charts/radix-oauth-guard/values.yaml rename to charts/radix-prometheus-proxy/values.yaml diff --git a/release-please-config.json b/release-please-config.json index 47db5df..6d202b6 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,13 +1,13 @@ { "packages": { + "charts/radix-prometheus-proxy": { + "release-type": "helm", + "package-name": "radix-prometheus-proxy-chart" + }, ".": { "changelog-path": "CHANGELOG.md", - "bump-minor-pre-major": false, - "bump-patch-for-minor-pre-major": false, - "draft": false, - "prerelease": false, "initial-version": "0.1.0", - "release-type": "go" + "release-type": "simple" } }, "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"