Skip to content

Commit 1aea04c

Browse files
committed
use github container registry
1 parent 996e214 commit 1aea04c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/docker-ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@ on:
55
tags:
66
- 'v*.*.*'
77

8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
812
jobs:
9-
docker:
13+
build-and-push-image:
1014
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: read
18+
packages: write
19+
1120
steps:
1221
-
1322
name: Checkout
@@ -30,7 +39,7 @@ jobs:
3039
with:
3140
# list of Docker images to use as base name for tags
3241
images: |
33-
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
42+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3443
# generate Docker tags based on the following events/attributes
3544
tags: |
3645
type=semver,pattern={{version}}
@@ -47,8 +56,9 @@ jobs:
4756
name: Login to DockerHub
4857
uses: docker/login-action@v3
4958
with:
50-
username: ${{ secrets.DOCKERHUB_USERNAME }}
51-
password: ${{ secrets.DOCKERHUB_TOKEN }}
59+
registry: ${{ env.REGISTRY }}
60+
username: ${{ github.actor }}
61+
password: ${{ secrets.GITHUB_TOKEN }}
5262
-
5363
name: Build and push
5464
id: docker_build

0 commit comments

Comments
 (0)