Skip to content

Commit

Permalink
fix: sha method bypassed
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiwalyakoparkar committed Sep 9, 2023
1 parent 4249a11 commit c47b3b2
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/build-push-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

# - name: Docker meta
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: kaiwalyakoparkar/busybox
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
tags: |
type=sha
images: kaiwalyakoparkar/busybox

- name: Get git sha short
id: vars
run: echo "name=sha_short::$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# - name: Get git sha short
# id: vars
# run: echo "name=sha_short::$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Log in to Docker Hub
uses: docker/login-action@v2
Expand All @@ -35,11 +37,9 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.vars.outputs.sha_short}}
labels: ${{ steps.vars.outputs.sha_short }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true

- name: Generate deploy manifest from Jinja template
uses: cuchi/jinja2-action@v1.2.0
Expand All @@ -48,7 +48,7 @@ jobs:
output_file: kubernetes/deploy.yaml
strict: true
variables: |
image_deploy_tag=sha-${{ steps.vars.outputs.sha_short }}
image_deploy_tag=sha-${{ steps.meta.outputs.tags }}
- name: Commit deploy manifest on local repo
run: |
Expand All @@ -60,5 +60,4 @@ jobs:
- name: Push deploy manifests to local repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.AUTO_COMMIT_TOKEN }}
branch: ${{ github.ref }}
github_token: ${{ secrets.AUTO_COMMIT_TOKEN }}

0 comments on commit c47b3b2

Please sign in to comment.