diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1c0ae92..a085d86 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -55,4 +55,16 @@ jobs: run: | docker buildx build --platform=linux/amd64 -t $ECR_REGISTRY/$ECR_REPOSITORY . docker push $ECR_REGISTRY/$ECR_REPOSITORY - echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY" \ No newline at end of file + + # S3에 업로드 + - name: Upload to s3 + run: + aws s3 cp --region ap-northeast-2 ./fullcar.zip s3://fullcar-build/deploy/ + + # Deploy 시작 + - name: Deploy with AWS codeDeploy + run: | + aws deploy create-deployment --application-name fullcar-codedeploy + --deployment-config-name CodeDeployDefault.OneAtATime + --deployment-group-name DEPLOY-GROUP + --s3-location bucket=fullcar-build,bundleType=zip,key=deploy/fullcar.zip \ No newline at end of file diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 84f0e3c..a74dc7c 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -3,4 +3,4 @@ $(aws ecr get-login --region ap-northeast-2 --no-include-email) sudo docker rm -f codedeploy sudo docker rmi "$ECR_REPOSITORY" sudo docker pull "$ECR_REPOSITORY" -sudo docker run -d --name codedeploy -p 8080:80 "$ECR_REPOSITORY" \ No newline at end of file +sudo docker run -d --name codedeploy -p 8080:80 --restart always "$ECR_REPOSITORY" \ No newline at end of file