Skip to content

Commit

Permalink
another attempt at using git branch and sha
Browse files Browse the repository at this point in the history
  • Loading branch information
imor committed Aug 14, 2024
1 parent d691227 commit 0597eb0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,20 @@ jobs:
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Declare branch and short_sha variables
shell: bash
run: |
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
echo "short_sha=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
- name: Build and push api image
uses: docker/build-push-action@v6
with:
file: ./api/Dockerfile
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/api:${{ github.head_ref }}.${{ github.sha }}
tags: ${{ vars.DOCKERHUB_USERNAME }}/api:${{ env.branch }}.${{ env.short_sha }}
- name: Build and push replicator image
uses: docker/build-push-action@v6
with:
file: ./replicator/Dockerfile
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/replicator:${{ github.head_ref }}.${{ github.sha }}
tags: ${{ vars.DOCKERHUB_USERNAME }}/replicator:${{ env.branch }}.${{ env.short_sha }}

0 comments on commit 0597eb0

Please sign in to comment.