Skip to content

Commit

Permalink
tag git repo with docker tag
Browse files Browse the repository at this point in the history
  • Loading branch information
assadriaz committed Dec 3, 2024
1 parent b6c0bc6 commit 40f0f69
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,18 @@ jobs:
java-version: 21
distribution: temurin
cache: maven
- name: set variables
run: |
echo "GHA_DOCKER_PUSH_IMAGE_TAG=`date +%Y-%m-%dT%H-%M`" >> $GITHUB_ENV
- name: Build container image with Jib, push to container repo
run: |
image_date=`date +%Y-%m-%dT%H-%M`
mvn --batch-mode compile com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_date
mvn --batch-mode compile com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,${{ env.GHA_DOCKER_PUSH_IMAGE_TAG }}
- name: Tag default branch with the container image tag ${{ env.GHA_DOCKER_PUSH_IMAGE_TAG }}
id: tag-version
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git tag --annotate "$GHA_DOCKER_PUSH_IMAGE_TAG" -m "chore(tag): $GHA_DOCKER_PUSH_IMAGE_TAG [skip ci]" --force
git push origin "$GHA_DOCKER_PUSH_IMAGE_TAG" --force

0 comments on commit 40f0f69

Please sign in to comment.