Skip to content

Commit

Permalink
Task A-2: Storing latest tag in .env file + Task A-8: Prefix branch name
Browse files Browse the repository at this point in the history
Refer to details in cleanup issue:
Task A-2: e-mission/e-mission-docs#1082 (comment)

Storing latest tag as well so that artifacts are not needed.

For now not removing artifacts until the internal script is updated to handle this change.

----

Task A-8: Prefixing branch name to the docker tag along with the date.
In the internal script we will not need to maintain the different branch lists as the images will be completely tagged in the external workflows themselves.
We can simply use the tags without modifications then.

For now, not prefixing the tag to the artifact since we will be removing the artifact anyways.
And current internal script works with artifacts.
Once I update the internal script, will come back and remove artifacts.
  • Loading branch information
Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Sep 21, 2024
1 parent 991e369 commit 107fe0b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JOIN_IMAGE_TAG=2024-08-21--29-53
24 changes: 24 additions & 0 deletions .github/workflows/image_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ jobs:
steps:

- uses: actions/checkout@v2

- name: Set docker image tags
id: set-tags
run: |
set -a; source .env; set +a
echo "JOIN_IMAGE_TAG=${JOIN_IMAGE_TAG}" >> "$GITHUB_OUTPUT"
echo "Current join-page image tag (push): ${JOIN_IMAGE_TAG}"
- name: docker login
run: | # log into docker hub account
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
Expand All @@ -37,6 +45,22 @@ jobs:
run: |
docker push $DOCKER_USER/${GITHUB_REPOSITORY#*/}:${GITHUB_REF##*/}_${{ steps.date.outputs.date }}
- name: Update .env file
run: |
echo "JOIN_IMAGE_TAG=${GITHUB_REF##*/}_${{ steps.date.outputs.date }}" > .env
- name: Add, Commit, Push changes to .env file
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions bot to update .env with latest tags"
if git diff --quiet; then
echo "Latest timestamp already present in .env file, no changes to commit"
else
git add .env
git commit -m "Updated docker image tags in .env file to the latest timestamp"
git push origin
fi
- name: Create artifact text file
run: |
echo ${{ steps.date.outputs.date }} > join_page_tag_file.txt
Expand Down

0 comments on commit 107fe0b

Please sign in to comment.