Skip to content

Commit

Permalink
chore(workflows):[DO-1264] Fix repository names in main docker workfl…
Browse files Browse the repository at this point in the history
…ows also
  • Loading branch information
ds-jkreutzfeld committed Oct 10, 2023
1 parent cc33457 commit ea54b40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/docker-image-main_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,18 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push docker image for GHCR ${{ env.GHCR_REGISTRY }}/${{ github.repository }}:${{ github.sha }}
- name: Make organization and repository name lowercase
run: echo "GITHUB_REPOSITORY_LOWERCASE=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Build & Push docker image for GHCR ${{ env.GHCR_REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWERCASE }}:${{ github.sha }}
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
if: env.DOCKER_HUB_USER == ''
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.GHCR_REGISTRY }}/${{ github.repository }}:${{ github.sha }}
tags: ${{ env.GHCR_REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWERCASE }}:${{ github.sha }}

- name: Login to Docker Hub
env:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/docker-image-main_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,18 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push to GHCR Registry ${{ env.GHCR_REGISTRY }}/${{ github.repository }}-frontend:${{ github.sha }}
- name: Make organization and repository name lowercase
run: echo "GITHUB_REPOSITORY_LOWERCASE=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Build and push to GHCR Registry ${{ env.GHCR_REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWERCASE }}-frontend:${{ github.sha }}
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
if: env.DOCKER_HUB_USER == ''
uses: docker/build-push-action@v4
with:
context: frontend
push: true
tags: ${{ env.GHCR_REGISTRY }}/${{ github.repository }}-frontend:${{ github.sha }}
tags: ${{ env.GHCR_REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWERCASE }}-frontend:${{ github.sha }}

- name: Login to Docker Hub
env:
Expand Down

0 comments on commit ea54b40

Please sign in to comment.