From 9e4998543d7e0516126fc94122161a60454208ac Mon Sep 17 00:00:00 2001 From: Jagadeesan Varadharaj Date: Tue, 2 Apr 2024 20:56:25 +0530 Subject: [PATCH 1/7] Create build-and-deploy --- .github/workflows/build-and-deploy | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/workflows/build-and-deploy diff --git a/.github/workflows/build-and-deploy b/.github/workflows/build-and-deploy new file mode 100644 index 000000000..45b983be3 --- /dev/null +++ b/.github/workflows/build-and-deploy @@ -0,0 +1 @@ +hi From fa1b059a028925668d0f45145619a4ba3df65927 Mon Sep 17 00:00:00 2001 From: Jagadeesan Varadharaj Date: Tue, 2 Apr 2024 20:56:58 +0530 Subject: [PATCH 2/7] Update push.yml --- .github/workflows/push.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index bb3c476a5..a2ad0a5bc 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,14 +1,14 @@ name: docker-compose-actions-workflow -on: - push: - branches: - - 'master' - paths-ignore: - - 'DCOS/**' - - 'K8s/**' - - 'load-gen/**' - - 'OpenShift/**' - - 'Swarm/**' +#on: +# push: +# branches: +# - 'master' +# paths-ignore: +# - 'DCOS/**' +# - 'K8s/**' +# - 'load-gen/**' +# - 'OpenShift/**' +# - 'Swarm/**' jobs: test: From 59c0b90ba3d9990b9b4eacc767d953f0a72307bd Mon Sep 17 00:00:00 2001 From: Jagadeesan Varadharaj Date: Tue, 2 Apr 2024 21:14:12 +0530 Subject: [PATCH 3/7] Update build-and-deploy --- .github/workflows/build-and-deploy | 59 +++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy b/.github/workflows/build-and-deploy index 45b983be3..839e7bea8 100644 --- a/.github/workflows/build-and-deploy +++ b/.github/workflows/build-and-deploy @@ -1 +1,58 @@ -hi + +name: app deploy to EKS +on: + pull_request: + branches: [ "master" ] + paths-ignore: + - 'DCOS/**' + - 'K8s/**' + - 'load-gen/**' + - 'OpenShift/**' + - 'Swarm/**' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install kubectl + uses: azure/setup-kubectl@v2.0 + with: + version: 'v1.24.0' # default is latest stable + id: install + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Build, tag, and push docker image to Amazon ECR + env: + REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REPOSITORY: robotshop + IMAGE_TAG: latest + run: | + cd web; + docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . + docker images +# docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG + +# - name: Update kube config +# run: | +# mkdir -p $HOME/.kube +# echo "$KUBE_CONFIG_DATA" | base64 -d > $HOME/.kube/config +# aws eks update-kubeconfig --region us-east-1 --name mycluster +# +# - name: Deploy to EKS +# run: | +# kubectl apply -f deployment.yaml +# kubectl apply -f service.yaml + From 8913993e9f14353956b493d3fcdcca83ffa147d3 Mon Sep 17 00:00:00 2001 From: Jagadeesan Varadharaj Date: Tue, 2 Apr 2024 21:16:49 +0530 Subject: [PATCH 4/7] Update build-and-deploy --- .github/workflows/build-and-deploy | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-and-deploy b/.github/workflows/build-and-deploy index 839e7bea8..8470a5524 100644 --- a/.github/workflows/build-and-deploy +++ b/.github/workflows/build-and-deploy @@ -1,4 +1,3 @@ - name: app deploy to EKS on: pull_request: From d3b7d69cef909170bd703be6c44fb8e6b1ae27a8 Mon Sep 17 00:00:00 2001 From: Jagadeesan Varadharaj Date: Tue, 2 Apr 2024 21:26:04 +0530 Subject: [PATCH 5/7] Update build-and-deploy --- .github/workflows/build-and-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy b/.github/workflows/build-and-deploy index 8470a5524..e2aa37929 100644 --- a/.github/workflows/build-and-deploy +++ b/.github/workflows/build-and-deploy @@ -54,4 +54,4 @@ jobs: # run: | # kubectl apply -f deployment.yaml # kubectl apply -f service.yaml - +# test From 7d0e11c266b163b24312d3b65e47f6419a91fb9d Mon Sep 17 00:00:00 2001 From: Jagadeesan Varadharaj Date: Tue, 2 Apr 2024 21:26:33 +0530 Subject: [PATCH 6/7] Update .env From 99f314919a323db349dc1de351a5171a478309e6 Mon Sep 17 00:00:00 2001 From: Jagadeesan Varadharaj Date: Tue, 2 Apr 2024 22:35:40 +0530 Subject: [PATCH 7/7] Delete .github/workflows/push.yml --- .github/workflows/push.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index a2ad0a5bc..000000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: docker-compose-actions-workflow -#on: -# push: -# branches: -# - 'master' -# paths-ignore: -# - 'DCOS/**' -# - 'K8s/**' -# - 'load-gen/**' -# - 'OpenShift/**' -# - 'Swarm/**' - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build the stack - run: docker-compose build