Skip to content

Commit

Permalink
Update and rename docker-publish-result.yml to docker-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sidhu2003 authored May 16, 2024
1 parent 104e56d commit 770ae27
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 30 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/docker-publish-result.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: push images to ECR
on:
push:
branches:
- main
env:
AWS_REGION: us-east-1
EKS_CLUSTER: votingapp-eks

jobs:

BUILD_AND_PUBLISH_RESULT:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v4

- name: Build & Upload image to ECR
uses: appleboy/docker-ecr-action@master
with:
access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
registry: result
repo: ${{ env.ECR_REPOSITORY }}
region: ${{ env.AWS_REGION }}
tags: latest,${{ github.run_number }}
daemon_off: false
dockerfile: ./result/Dockerfile
context: ./result

BUILD_AND_PUBLISH_VOTE:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v4

- name: Build & Upload image to ECR
uses: appleboy/docker-ecr-action@master
with:
access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
registry: vote
repo: ${{ env.ECR_REPOSITORY }}
region: ${{ env.AWS_REGION }}
tags: latest,${{ github.run_number }}
daemon_off: false
dockerfile: ./vote/Dockerfile
context: ./vote


BUILD_AND_PUBLISH_WORKER:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v4

- name: Build & Upload image to ECR
uses: appleboy/docker-ecr-action@master
with:
access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
registry: worker
repo: ${{ env.ECR_REPOSITORY }}
region: ${{ env.AWS_REGION }}
tags: latest,${{ github.run_number }}
daemon_off: false
dockerfile: ./worker/Dockerfile
context: ./worker


0 comments on commit 770ae27

Please sign in to comment.