Skip to content

Commit

Permalink
fix(worflow): tag and version
Browse files Browse the repository at this point in the history
  • Loading branch information
arhamj committed Oct 23, 2024
1 parent 4ea5d12 commit 12fbf4c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get short commit hash
id: get-short-hash
run: echo "SHORT_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Determine branch name
id: get-branch-name
- name: Declare version variables
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV # Source branch of the PR
else
echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV # Actual branch name for push events
fi
echo "SHORT_COMMIT_HASH=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
- name: Echo step
run: |
echo "Branch: ${{ env.SHORT_COMMIT_HASH }}"
echo "Sha: ${{ env.BRANCH_NAME }}"
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
Expand Down

0 comments on commit 12fbf4c

Please sign in to comment.