add build step to the workflow

This commit is contained in:
teddy931130 2025-01-15 20:16:51 +02:00
parent c040759a16
commit 62820feae5

View file

@ -66,17 +66,24 @@ jobs:
fi fi
echo "new-tag=${NEW_TAG}" >> $GITHUB_OUTPUT echo "new-tag=${NEW_TAG}" >> $GITHUB_OUTPUT
# - name: Build and push Docker Image - name: Build and push Docker Image
# run: | run: |
# FULL_ECR_URL="${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPO_NAME }}" FULL_ECR_URL="${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPO_NAME }}"
# NEW_TAG="${{ steps.get-latest-tag.outputs.new-tag }}" NEW_TAG="${{ steps.get-latest-tag.outputs.new-tag }}"
# docker build \ # define build args for the image
# --build-arg VAR="VALUE" \ COMMIT=${{ github.sha }}
# -t "${FULL_ECR_URL}:${NEW_TAG}" \ VERSION=$NEW_TAG
# -f Dockerfile . BUILDNUM=$(git rev-list --count HEAD)
# docker push "${FULL_ECR_URL}:${NEW_TAG}" docker build \
--build-arg COMMIT="${COMMIT}" \
--build-arg VERSION="${VERSION}" \
--build-arg BUILDNUM="${BUILDNUM}" \
-t "${FULL_ECR_URL}:${NEW_TAG}" \
-f Dockerfile .
docker push "${FULL_ECR_URL}:${NEW_TAG}"
- name: Notify PR of New Tag - name: Notify PR of New Tag
if: ${{ inputs.create_tag }} == 'true' if: ${{ inputs.create_tag }} == 'true'