Skip to content

Commit 1adf85f

Browse files
Merge pull request #73 from Arnab-Developer/docker-login
Docker login action
2 parents 3be0808 + d8c9cef commit 1adf85f

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
@@ -77,11 +77,15 @@ jobs:
7777
- name: Docker build
7878
run: docker build -f 'src/ApiHealthCheck.Console/Dockerfile' -t ghcr.io/arnab-developer/apihealthcheck/apihealthcheck:${{ env.DOCKER_VERSION }} .
7979

80+
- name: GitHub Container Registry login
81+
uses: docker/login-action@v1
82+
with:
83+
registry: ghcr.io
84+
username: ${{ github.actor }}
85+
password: ${{ secrets.GITHUB_TOKEN }}
86+
8087
- name: Docker push
81-
run: |
82-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u Arnab-Developer --password-stdin
83-
docker push ghcr.io/arnab-developer/apihealthcheck/apihealthcheck:${{ env.DOCKER_VERSION }}
84-
docker logout ghcr.io
88+
run: docker push ghcr.io/arnab-developer/apihealthcheck/apihealthcheck:${{ env.DOCKER_VERSION }}
8589

8690
dockerhub-deploy:
8791
if: ${{ github.event_name == 'release' }}
@@ -109,8 +113,11 @@ jobs:
109113
- name: Docker build
110114
run: docker build -f 'src/ApiHealthCheck.Console/Dockerfile' -t 45862391/apihealthcheck:${{ env.DOCKER_VERSION }} .
111115

116+
- name: Login to Docker Hub
117+
uses: docker/login-action@v1
118+
with:
119+
username: ${{ 45862391 }}
120+
password: ${{ secrets.DOCKERHUB_PWD }}
121+
112122
- name: Docker push
113-
run: |
114-
echo "${{ secrets.DOCKERHUB_PWD }}" | docker login -u 45862391 --password-stdin
115-
docker push 45862391/apihealthcheck:${{ env.DOCKER_VERSION }}
116-
docker logout
123+
run: docker push 45862391/apihealthcheck:${{ env.DOCKER_VERSION }}

0 commit comments

Comments
 (0)