From bbdc15a04069c136cb83f7742b13a94943976180 Mon Sep 17 00:00:00 2001 From: versatile0010 Date: Thu, 12 Oct 2023 01:24:09 +0900 Subject: [PATCH] Chore(#13): cicd target branch set up --- .github/workflows/cicd.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 2372554c..991d84f7 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -4,7 +4,7 @@ name: NumberOne-Backend-CICD # event trigger on: push: - branches: [ "main", "feat/cicd" ] + branches: [ "main" ] pull_request: branches: [ "main" ] @@ -41,7 +41,7 @@ jobs: shell: bash - name: docker-compose.yml to EC2 server - if: contains(github.ref, 'main') || contains(github.ref, 'feat/cicd') + if: contains(github.ref, 'main') uses: appleboy/scp-action@master with: username: ubuntu @@ -55,7 +55,7 @@ jobs: timeout: 1m - name: create application.yml - if: contains(github.ref, 'main') || contains(github.ref, 'feat/cicd') + if: contains(github.ref, 'main') run: | mkdir ./src/main/resources cd ./src/main/resources @@ -64,13 +64,13 @@ jobs: shell: bash - name: Build With Gradle - if: contains(github.ref, 'main') || contains(github.ref, 'feat/cicd') + if: contains(github.ref, 'main') run: ./gradlew build -x test ## docker build & push to production - name: Docker build & push to prod - if: contains(github.ref, 'main') || contains(github.ref, 'feat/cicd') + if: contains(github.ref, 'main') run: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }} . @@ -81,7 +81,7 @@ jobs: - name: Deploy uses: appleboy/ssh-action@master id: deploy-prod - if: contains(github.ref, 'main') || contains(github.ref, 'feat/cicd') + if: contains(github.ref, 'main') with: host: ${{ secrets.EC2_HOST }} username: ${{ secrets.EC2_USERNAME }}