From 570a44e3ff6f58aa80790664a281945d4a0ad5c8 Mon Sep 17 00:00:00 2001 From: BYOENGRYEOL Date: Wed, 7 Aug 2024 22:19:18 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20docker-compose.yml=20=EA=B2=BD=EB=A1=9C?= =?UTF-8?q?=EB=A5=BC=20=EB=A3=A8=ED=8A=B8=EB=A1=9C=20=EC=95=95=EC=B6=95?= =?UTF-8?q?=ED=95=A0=EC=88=98=EC=9E=88=EB=8F=84=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd-ec2.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd-ec2.yml b/.github/workflows/cicd-ec2.yml index e4ef8195..c3749838 100644 --- a/.github/workflows/cicd-ec2.yml +++ b/.github/workflows/cicd-ec2.yml @@ -135,9 +135,22 @@ jobs: - name: Upload docker-compose, appspec, afterInstall file to S3 if: contains(github.ref, 'main') run: | - zip -r ./$GITHUB_SHA.zip ./scripts appspec.yml docker-compose.yml .env + # Create a temporary directory for the zip contents + mkdir -p temp_dir/scripts + cp -r ./scripts/* temp_dir/scripts/ + cp appspec.yml temp_dir/ + cp ./docker/deploy/docker-compose.yml temp_dir/docker-compose.yml + + # Navigate to the temporary directory and create the zip file + cd temp_dir + zip -r ../$GITHUB_SHA.zip ./* + + # Move back to the initial directory and upload the zip file to S3 + cd .. aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME - + + # Clean up the temporary directory + rm -rf temp_dir - name: Upload docker compose file to staging server if: contains(github.ref, 'staging')