Skip to content

Commit

Permalink
set env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Paulic committed Sep 20, 2024
1 parent 1f00745 commit 402972f
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/reusable-workflow-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
docker-build:
runs-on: ubuntu-latest

env:
env:
IMAGE_NAME: ${{ inputs.container-name }}
IMAGE_TAG: "${{ github.run_number }}"
REGISTRY: ${{ secrets.REGISTRY }}

Expand All @@ -30,21 +31,14 @@ jobs:
password: ${{ secrets.ACR_PASSWORD }}

- name: Build Docker Image
with:
container-name: ${{ inputs.container-name }}
dockerfile: ${{ inputs.cdockerfile }}
run: docker build -t $REGISTRY/$container-name:$IMAGE_TAG $dockerfile
run: docker build -t $REGISTRY/$IMAGE_NAME:$IMAGE_TAG $dockerfile

- name: Push Docker image
with:
container-name: ${{ inputs.container-name }}
run: |
docker push $REGISTRY/$container-name:$IMAGE_TAG
docker push $REGISTRY/$IMAGE_NAME:$IMAGE_TAG
- name: Tag and push Docker image as latest
# if: github.ref == 'refs/heads/main' # TODO: uncomment once we are done with development
with:
container-name: ${{ inputs.container-name }}
run: |
docker tag $REGISTRY/$container-name:$IMAGE_TAG $REGISTRY/$container-name:latest
docker push $REGISTRY/$container-name:latest
docker tag $REGISTRY/$IMAGE_NAME:$IMAGE_TAG $REGISTRY/$IMAGE_NAME:latest
docker push $REGISTRY/$IMAGE_NAME:latest

0 comments on commit 402972f

Please sign in to comment.