Skip to content

Spring Security Fully implemented, and CI/CD pipeline for event-servi… #5

Spring Security Fully implemented, and CI/CD pipeline for event-servi…

Spring Security Fully implemented, and CI/CD pipeline for event-servi… #5

#name: Deploy Event Service to Amazon ECS
#
#on:
# push:
## branches: [ "main" ]
## # PRO TIP: Only run this pipeline if files in the event-service folder change
## paths:
## - 'event-service/**'
#
#env:
# AWS_REGION: us-east-1
# ECR_REPOSITORY: event-service
# ECS_SERVICE: event-service
# ECS_CLUSTER: stream-seat-cluster
# CONTAINER_NAME: event-service-container
#
#jobs:
# deploy:
# runs-on: ubuntu-latest
#
# # This tells GitHub to run all 'run' commands inside the event-service directory
# defaults:
# run:
# working-directory: ./event-service
#
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
#
# - name: Set up JDK 17
# uses: actions/setup-java@v3
# with:
# java-version: '17'
# distribution: 'temurin'
# cache: maven
#
# - name: Build JAR with Maven
# run: mvn clean package -DskipTests
#
# - 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: ${{ env.AWS_REGION }}
#
# - name: Login to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v1
#
# - name: Build, Tag, and Push Image to ECR
# env:
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# run: |
# # buildx is used for AMD64 compatibility on Fargate
# docker buildx create --use
# docker buildx build --platform linux/amd64 \
# -t $ECR_REGISTRY/$ECR_REPOSITORY:latest \
# --push .
#
# - name: Force ECS Deployment
# run: |
# aws ecs update-service --cluster ${{ env.ECS_CLUSTER }} \
# --service ${{ env.ECS_SERVICE }} \
# --force-new-deployment