From b8424880e2582561253e6218f5ef98c51417dc44 Mon Sep 17 00:00:00 2001 From: kimjihye Date: Fri, 20 Dec 2024 15:01:36 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20CI/CD=20=EB=B6=84=EB=A6=AC=20git=20token?= =?UTF-8?q?=20=EB=B6=80=EC=97=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/itcast-build-and-deploy.yml | 7 +++- .github/workflows/itcast-build-and-test.yml | 39 +------------------ 2 files changed, 7 insertions(+), 39 deletions(-) diff --git a/.github/workflows/itcast-build-and-deploy.yml b/.github/workflows/itcast-build-and-deploy.yml index 916b6421..7ee866e8 100644 --- a/.github/workflows/itcast-build-and-deploy.yml +++ b/.github/workflows/itcast-build-and-deploy.yml @@ -16,6 +16,11 @@ jobs: packages: write steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + token: ${{ secrets.KJH_TOKEN }} + - name: Checkout code uses: actions/checkout@v3 @@ -77,7 +82,7 @@ jobs: aws-secret-access-key: ${{secrets.AWS_KJH_SECRET_ACCESS_KEY}} - name: Upload to S3 - run: aws s3 cp ./$GITHUB_SHA.zip s3://${{ secrets.AWS_S3_BUCKET }}/$GITHUB_SHA.zip + run: aws s3 cp ./$GITHUB_SHA.zip s3://${{ secrets.AWS_KJH_S3_BUCKET }}/$GITHUB_SHA.zip - name: EC2 Deploy run: aws deploy create-deployment diff --git a/.github/workflows/itcast-build-and-test.yml b/.github/workflows/itcast-build-and-test.yml index f400131f..d917a881 100644 --- a/.github/workflows/itcast-build-and-test.yml +++ b/.github/workflows/itcast-build-and-test.yml @@ -51,41 +51,4 @@ jobs: - name: Tear down Docker Compose if: always() - run: docker-compose down - - # DI - - name: Set Yaml - uses: microsoft/variable-substitution@v1 - with: - files: ./application-prod.yml - env: - spring.datasource.url: ${{secrets.KJH_MYSQL_URL}} - spring.datasource.username: ${{ secrets.KJH_DB_USERNAME }} - spring.datasource.password: ${{ secrets.KJH_DB_PASSWORD }} - spring.data.redis.host: ${{ secrets.KJH_REDIS_HOST }} - spring.data.redis.port: ${{ secrets.KJH_REDIS_PORT }} - - - name: Grant execute permission for gradlew - run: chmod +x ./gradlew - shell: bash - - - name: Make Zip file - run: zip -r $GITHUB_SHA.zip build/libs/*.jar appspec.yml scripts/deploy.sh - shell: bash - - - name: AWS credential setting - uses: aws-actions/configure-aws-credentials@v3 - with: - aws-region: ${{secrets.AWS_KJH_REGION}} - aws-access-key-id: ${{secrets.AWS_KJH_ACCESS_KEY}} - aws-secret-access-key: ${{secrets.AWS_KJH_SECRET_ACCESS_KEY}} - - - name: Upload to S3 - run: aws s3 cp ./$GITHUB_SHA.zip s3://${{ secrets.AWS_KJH_S3_BUCKET }}/$GITHUB_SHA.zip - - - name: EC2 Deploy - run: aws deploy create-deployment - --application-name ${{secrets.AWS_KJH_CODE_DEPLOY_APPLICATION}} - --deployment-config-name CodeDeployDefault.AllAtOnce - --deployment-group-name ${{secrets.AWS_KJH_CODE_DEPLOY_GROUP}} - --s3-location bucket=${{secrets.AWS_KJH_S3_BUCKET}},key=$GITHUB_SHA.zip,bundleType=zip \ No newline at end of file + run: docker-compose down \ No newline at end of file