Skip to content

Commit

Permalink
ci: convert repository to lowercase for docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbutt committed Feb 13, 2024
1 parent 8a35e42 commit ebaa6c4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,19 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Convert github.repo to Lowercase
id: repository
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.repository }}

- name: Build
run: |
docker build . --tag ghcr.io/${{ github.repository }}:latest
docker tag ghcr.io/${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${{ github.sha }}
docker build . --tag ghcr.io/${{ steps.repository.outputs.lowercase }}:latest
docker tag ghcr.io/${{ steps.repository.outputs.lowercase }}:latest ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}
- name: Push
run: docker push ghcr.io/${{ github.repository }}:latest
run: docker push ghcr.io/${{ steps.repository.outputs.lowercase }}:latest

0 comments on commit ebaa6c4

Please sign in to comment.