Skip to content

Commit 69efb5a

Browse files
authored
Update Docker image workflow for GHCR
Normalized the image name to lowercase and updated Docker commands to use the GitHub Container Registry.
1 parent 54d20d9 commit 69efb5a

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
env:
99
REGISTRY: ghcr.io
10-
IMAGE_NAME: ${{ github.repository }}
1110

1211
jobs:
1312
build:
@@ -21,21 +20,25 @@ jobs:
2120
- name: Checkout repository
2221
uses: actions/checkout@v4
2322

24-
- name: Login to GHCR
23+
- name: Normalize image name (lowercase)
24+
run: |
25+
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
26+
27+
- name: Login to GitHub Container Registry
2528
run: |
2629
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io \
2730
-u "${{ github.actor }}" \
2831
--password-stdin
2932
30-
- name: Build Docker image (manual)
33+
- name: Build Docker image
3134
run: |
3235
docker build \
3336
-f backend/Dockerfile \
34-
-t aavtic/$IMAGE_NAME:latest \
35-
-t aavtic/$IMAGE_NAME:${{ github.sha }} \
37+
-t $REGISTRY/$IMAGE_NAME:latest \
38+
-t $REGISTRY/$IMAGE_NAME:${{ github.sha }} \
3639
backend
3740
3841
- name: Push Docker image
3942
run: |
40-
docker push aavtic/$IMAGE_NAME:latest
41-
docker push aavtic/$IMAGE_NAME:${{ github.sha }}
43+
docker push $REGISTRY/$IMAGE_NAME:latest
44+
docker push $REGISTRY/$IMAGE_NAME:${{ github.sha }}

0 commit comments

Comments
 (0)