File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -49,23 +49,31 @@ jobs:
4949 deploy :
5050 needs : build-and-push
5151 runs-on : ubuntu-latest
52-
5352 steps :
54- # 5. OCI 서버에 SSH로 접속하여 배포 명령 전달
55- - name : Deploy to OCI
53+ - name : Checkout repository
54+ uses : actions/checkout@v4
55+
56+ # [추가] docker-compose.yml 파일을 서버로 전송
57+ - name : Copy docker-compose.yml to OCI
58+ uses : appleboy/scp-action@v0.1.7
59+ with :
60+ host : ${{ secrets.OCI_HOST }}
61+ username : ${{ secrets.OCI_USERNAME }}
62+ key : ${{ secrets.OCI_KEY }}
63+ source : " docker-compose.yml"
64+ target : " ~/marksphere-project"
65+
66+ - name : Deploy to OCI via SSH
5667 uses : appleboy/ssh-action@v1.0.3
5768 with :
5869 host : ${{ secrets.OCI_HOST }}
5970 username : ${{ secrets.OCI_USERNAME }}
6071 key : ${{ secrets.OCI_KEY }}
6172 script : |
62- cd ~/marksphere-project # 프로젝트 폴더 경로로 이동
73+ cd ~/marksphere-project
74+ # [중요] docker-compose.yml 파일 내의 이미지를 GHCR 이미지로 강제 지정
75+ sed -i 's/build: ./image: ghcr.io\/social-bookmarking\/back:latest/' docker-compose.yml
6376
64- # 새 이미지 가져오기
6577 docker-compose pull
66-
67- # 컨테이너 재시작 (변경사항 반영)
6878 docker-compose up -d --force-recreate
69-
70- # 사용하지 않는 오래된 이미지 정리 (용량 관리)
7179 docker image prune -f
You can’t perform that action at this time.
0 commit comments