From 19aad2e5dba09dac02425b6f1e9bfea861590a8c Mon Sep 17 00:00:00 2001 From: kaswhy Date: Thu, 14 Nov 2024 01:39:39 +0900 Subject: [PATCH] =?UTF-8?q?fix(all):=20=EA=B9=83=ED=97=88=EB=B8=8C=20?= =?UTF-8?q?=EC=A0=91=EA=B7=BC=20=EA=B4=80=EB=A0=A8=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9E=90=20=EC=A0=95=EB=B3=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 변경 후 - 해당 변경 사항 반영 --- .github/workflows/deploy.yml | 6 ++++++ scripts/initialize.sh | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5a0f654..04f277e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,6 +14,12 @@ jobs: - name: Checkout source code uses: actions/checkout@v2 + - name: Set up Git credentials + run: echo "https://${{ secrets.GH_USERNAME }}:${{ secrets.GH_PAT }}@github.com" > ~/.git-credentials + + - name: Configure Git to use credentials from file + run: git config --global credential.helper store + # 파일 및 폴더를 압축하여 server.zip으로 저장 - name: Zip distributions run: zip -r server.zip . diff --git a/scripts/initialize.sh b/scripts/initialize.sh index 2b37608..92e843a 100644 --- a/scripts/initialize.sh +++ b/scripts/initialize.sh @@ -1,2 +1,11 @@ +# Parameter Store에서 GitHub 자격 증명을 가져오기 +GH_USERNAME=$(aws ssm get-parameter --name "/github/username" --with-decryption --query "Parameter.Value" --output text) +GH_PAT=$(aws ssm get-parameter --name "/github/token" --with-decryption --query "Parameter.Value" --output text) + +# GitHub 자격 증명 파일 설정 +echo "https://${GH_USERNAME}:${GH_PAT}@github.com" > ~/.git-credentials +git config --global credential.helper store + + cd /home/ubuntu/Server git pull origin master \ No newline at end of file