File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 11name : CI/CD — Backend (Build → Push → Deploy)
22
33on :
4+ # dev에 머지 전 ci push 대상 브랜치 중첩 적용 (release, dev)
45 push :
5- branches : [ release ]
6+ branches : [ release, dev ]
7+ pull_request :
8+ branches : [ dev ]
69 workflow_dispatch : {}
710
811jobs :
@@ -57,14 +60,21 @@ jobs:
5760 echo "No Dockerfile found"; exit 1
5861 fi
5962
63+ - name : Build image (PR only)
64+ if : github.event_name == 'pull_request'
65+ run : |
66+ docker build -f "${{ steps.df.outputs.path }}" -t sanity-check:pr "${{ steps.df.outputs.ctx }}"
67+
6068 - name : Log in to GHCR
69+ if : github.event_name == 'push'
6170 uses : docker/login-action@v3
6271 with :
6372 registry : ghcr.io
6473 username : ${{ github.actor }}
6574 password : ${{ secrets.GITHUB_TOKEN }}
6675
6776 - name : Build & Push image
77+ if : github.event_name == 'push'
6878 run : |
6979 GIT_SHA=${{ github.sha }}
7080 docker build -f "${{ steps.df.outputs.path }}" -t $IMAGE:release -t $IMAGE:$GIT_SHA "${{ steps.df.outputs.ctx }}"
7383
7484 deploy :
7585 needs : build-and-push
76- if : github.ref == 'refs/heads/release' && needs.build-and-push.result == 'success'
86+ # dev에 머지 전 cd 대상 브랜치 중첩 적용 (release, dev)
87+ if : github.event_name == 'push' && (github.ref == 'refs/heads/release' || github.ref == 'refs/heads/dev') && needs.build-and-push.result == 'success'
7788 runs-on : ubuntu-latest
7889 steps :
7990 - name : Deploy
You can’t perform that action at this time.
0 commit comments