Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Existing git tag to build and push (e.g. v1.0.0)'
required: true
type: string

permissions:
contents: write
packages: write

env:
DOMAIN: vector
TAG: ${{ github.event.inputs.tag || github.ref_name }}

jobs:
push-docker-image:
Expand All @@ -30,6 +37,8 @@ jobs:
steps:
- name: Check out Git repository
uses: actions/checkout@v5
with:
ref: ${{ env.TAG }}

- name: Login to Azure Container Registry
uses: docker/login-action@v3
Expand All @@ -45,15 +54,15 @@ jobs:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ secrets.ACR_URL }}/${{ env.DOMAIN }}/${{ matrix.image }}:${{ github.ref_name }}
tags: ${{ secrets.ACR_URL }}/${{ env.DOMAIN }}/${{ matrix.image }}:${{ env.TAG }}

- name: Update Docker Image in artifacts.json
uses: MapColonies/shared-workflows/actions/update-artifacts-file@update-artifacts-file-v1
with:
domain: ${{ env.DOMAIN }}
type: docker
artifact_name: ${{ matrix.image }}
artifact_tag: ${{ github.ref_name }} # Using the git tag directly
artifact_tag: ${{ env.TAG }}
registry: ${{ secrets.ACR_URL }}
github_token: ${{ secrets.GH_PAT }}

Expand All @@ -63,12 +72,12 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v5
with:
ref: ${{ env.TAG }}

- name: Remove v from the tag
id: remove_v
run: |
TAG=${{ github.ref_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_OUTPUT
run: echo "VERSION=${TAG#v}" >> $GITHUB_OUTPUT

- name: Push Chart to ACR
uses: appany/helm-oci-chart-releaser@v0.5.0
Expand All @@ -80,7 +89,7 @@ jobs:
registry: ${{ secrets.ACR_URL }}
registry_username: ${{ secrets.ACR_PUSH_USER }}
registry_password: ${{ secrets.ACR_PUSH_TOKEN }}
update_dependencies: 'true' # Defaults to false
update_dependencies: 'true'

- name: Update Helm Package in artifacts.json
uses: MapColonies/shared-workflows/actions/update-artifacts-file@update-artifacts-file-v1
Expand Down
Loading