Skip to content

Commit 073fc69

Browse files
Merge pull request #12 from Arnab-Developer/docker-login
Docker login action
2 parents 1c48326 + c6a79c4 commit 073fc69

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

.github/workflows/ci-cd.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,15 @@ jobs:
7474
- name: Docker build
7575
run: docker build -f 'HttpHealthCheckDashboard/Dockerfile' -t ghcr.io/arnab-developer/httphealthcheckdashboard/httphealthcheckdashboard:2.0.8 .
7676

77+
- name: GitHub Container Registry login
78+
uses: docker/login-action@v1
79+
with:
80+
registry: ghcr.io
81+
username: ${{ github.actor }}
82+
password: ${{ secrets.GITHUB_TOKEN }}
83+
7784
- name: Docker push
78-
run: |
79-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u Arnab-Developer --password-stdin
80-
docker push ghcr.io/arnab-developer/httphealthcheckdashboard/httphealthcheckdashboard:2.0.8
81-
docker logout ghcr.io
85+
run: docker push ghcr.io/arnab-developer/httphealthcheckdashboard/httphealthcheckdashboard:2.0.8
8286

8387
dockerhub-deploy:
8488
if: ${{ github.event_name == 'release' }}
@@ -104,8 +108,11 @@ jobs:
104108
- name: Docker build
105109
run: docker build -f 'HttpHealthCheckDashboard/Dockerfile' -t 45862391/httphealthcheckdashboard:2.0.8 .
106110

111+
- name: Login to Docker Hub
112+
uses: docker/login-action@v1
113+
with:
114+
username: ${{ 45862391 }}
115+
password: ${{ secrets.DOCKERHUB_PWD }}
116+
107117
- name: Docker push
108-
run: |
109-
echo "${{ secrets.DOCKERHUB_PWD }}" | docker login -u 45862391 --password-stdin
110-
docker push 45862391/httphealthcheckdashboard:2.0.8
111-
docker logout
118+
run: docker push 45862391/httphealthcheckdashboard:2.0.8

0 commit comments

Comments
 (0)