Skip to content

Commit 0b4e274

Browse files
committed
fix: update CI workflow to deploy to Azure Container Registry instead of Docker Hub
1 parent 5b0dbb7 commit 0b4e274

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,30 @@ jobs:
5555
npx prisma migrate deploy
5656
npm test
5757
58+
deploy:
59+
needs: build-and-test
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout code to runner
64+
uses: actions/checkout@v2
65+
5866
- name: Create short SHA for tagging
5967
uses: benjlevesque/short-sha@v3.0
6068
id: short-sha
6169
with:
6270
length: 7
6371

64-
- name: Log in to Docker Hub
65-
uses: docker/login-action@v2
72+
- name: Login to Azure Container Registry
73+
uses: azure/docker-login@v1
6674
with:
67-
username: ${{ secrets.DOCKER_USERNAME }}
68-
password: ${{ secrets.DOCKER_PASSWORD }}
75+
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
76+
username: ${{ secrets.ACR_LOGIN_USERNAME }}
77+
password: ${{ secrets.ACR_LOGIN_PASSWORD }}
78+
- run: |
6979
70-
- name: Build and Push Docker Image to @Docker Hub
71-
uses: docker/build-push-action@v3
72-
with:
73-
context: .
74-
push: true
75-
tags: |
76-
${{ secrets.DOCKER_USERNAME }}/express-server:${{ steps.short-sha.outputs.sha }}
77-
${{ secrets.DOCKER_USERNAME }}/express-server:latest
80+
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/express-server:${{ steps.short-sha.outputs.short_sha }} .
81+
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/express-server:latest .
82+
83+
docker push ${{ secrets.ACR_LOGIN_SERVER }}/express-server:${{ steps.short-sha.outputs.short_sha }}
84+
docker push ${{ secrets.ACR_LOGIN_SERVER }}/express-server:latest

0 commit comments

Comments
 (0)