Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVOPS-453] Fix image refs to use GitHub SHAs #118

Merged
merged 2 commits into from
Apr 30, 2024
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
13 changes: 7 additions & 6 deletions .github/workflows/aks-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,17 @@ jobs:
contentTypes: BuildArg Env

- name: Build Docker Image
run: docker build ${{ steps.get-envs.outputs.buildArguments }} -t "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.event.release.tag_name || github.sha }}" ${{ inputs.dockerFilePath }}
run: docker build ${{ steps.get-envs.outputs.buildArguments }} -t "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.sha }}" ${{ inputs.dockerFilePath }}

- name: Tag Docker Image
run: |
if [[ "${{ inputs.environment }}" == "production" ]] ; then
docker tag "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.event.release.tag_name || github.sha }}" "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:latest"
docker tag "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.sha }}" "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:latest"
fi
if [[ "${{ github.event.release.tag_name || github.sha }}" == "${{ github.event.release.tag_name }}" ]]; then
if [[ "${{ github.event.release.tag_name }}" != "" ]]; then
docker tag "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.sha }}" "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.event.release.tag_name }}"
MAJOR_RELEASE=$(echo "${{ github.event.release.tag_name }}" | cut -d "." -f 1)
docker tag "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.event.release.tag_name || github.sha }}" "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${MAJOR_RELEASE}"
docker tag "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.sha }}" "${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${MAJOR_RELEASE}"
fi

- name: Login to Azure Container Registry
Expand Down Expand Up @@ -309,7 +310,7 @@ jobs:
overrideFiles: ./values-override.yaml
overrides: |
image.repository:${{ secrets.registryHostName }}/${{ github.event.repository.name }}
image.tag:${{ github.event.release.tag_name || github.sha }}
image.tag:${{ github.sha }}
ingress.host:${{ needs.build.outputs.ingress }}
autoscaling.maxReplicas:${{ inputs.maximumReplicas }}

Expand Down Expand Up @@ -379,7 +380,7 @@ jobs:
namespace: ${{ steps.namespace.outputs.namespace }}
manifests: ${{ steps.bake.outputs.manifestsBundle }}
images: |
"${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.event.release.tag_name || github.sha }}"
"${{ secrets.registryHostName }}/${{ github.event.repository.name }}:${{ github.sha }}"
imagepullsecrets: |
"${{ needs.build.outputs.imagePullSecret }}"
pull-images: false
Expand Down
Loading