Skip to content

Commit

Permalink
replace with ACR
Browse files Browse the repository at this point in the history
  • Loading branch information
visoedhwa committed Sep 3, 2024
1 parent cc3c38f commit 5962f0b
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Build Image and Deploy to AWS ECR
name: Docker Build Image and Deploy to Azure Container Registry
on:
push:
branches: ["main"]
Expand All @@ -14,23 +14,18 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
- name: Login to ACR
uses: docker/login-action@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
aws-region: ca-central-1
registry: ${{ secrets.AZURE_REGISTRY }}
username: ${{ secrets.AZURE_CLIENT_ID }}
password: ${{ secrets.AZURE_CLIENT_SECRET }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build, tag, and push image to Amazon ECR
- name: Build, tag, and push image to Azure Container Registry
env:
ECR_REGISTRY: ${{ secrets.AWS_REGISTRY }}
ECR_REPOSITORY: scheduler-api
AZURE_REGISTRY: ${{ secrets.AZURE_REGISTRY }}
REPO_NAME: ${{ github.event.repository.name }}
IMAGE_TAG: latest
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker build -t $AZURE_REGISTRY/$REPO_NAME:$IMAGE_TAG .
docker push $AZURE_REGISTRY/$REPO_NAME:$IMAGE_TAG

0 comments on commit 5962f0b

Please sign in to comment.