Skip to content

Commit

Permalink
Chore(#13): cicd target branch set up
Browse files Browse the repository at this point in the history
  • Loading branch information
versatile0010 committed Oct 11, 2023
1 parent 2abac58 commit bbdc15a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: NumberOne-Backend-CICD
# event trigger
on:
push:
branches: [ "main", "feat/cicd" ]
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }} .
Expand All @@ -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 }}
Expand Down

0 comments on commit bbdc15a

Please sign in to comment.