diff --git a/.github/workflows/itcast-build-and-deploy.yml b/.github/workflows/itcast-build-and-deploy.yml index 916b642..7ee866e 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 f400131..d917a88 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