Skip to content

Commit

Permalink
Merge pull request #141 from makevook/issue/140
Browse files Browse the repository at this point in the history
chore: 운영환경 배포 스크립트 추가
  • Loading branch information
seungyeop-lee authored Jul 13, 2024
2 parents eb94ed4 + b0af76d commit 3fd6474
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy to Prod Environment

on:
workflow_dispatch:
pull_request:
branches:
- main
types:
- closed

jobs:
deploy:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy
uses: dagger/dagger-for-github@v5
env:
SSH_DEST: ${{ secrets.PROD_SSH_DEST }}
SSH_KEY: ${{ secrets.PROD_SSH_KEY }}
with:
version: 0.12.0
verb: call
module: ./cicd
args: >-
deploy
--source-dir=api
--profile=prod
--ssh-dest=env:SSH_DEST
--ssh-key=env:SSH_KEY
--target-path=~/repo/makevook/vook-deployment/prod
--version=${{ github.sha }}
--command="make deploy-api"
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import vook.server.api.devhelper.app.InitService;
import vook.server.api.web.common.response.CommonApiResponse;

@Profile({"local", "dev", "stag"})
@Profile({"local", "dev", "stag", "prod"})
@RestController
@RequestMapping("/init")
@RequiredArgsConstructor
Expand Down
11 changes: 11 additions & 0 deletions cicd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ deploy-stag:
--version=${VERSION} \
--command="make deploy-api"

.PHONY:deploy-prod
deploy-prod:
dagger call -v deploy \
--source-dir=../api \
--profile=prod \
--ssh-dest=file:./secrets/prod/dest.txt \
--ssh-key=file:./secrets/prod/ssh.key \
--target-path=~/repo/makevook/vook-deployment/prod \
--version=${VERSION} \
--command="make deploy-api"

.PHONY:build-jar
build-jar:
dagger call -v build-api-jar --dir=../api --test export --path out/api.jar
Expand Down

0 comments on commit 3fd6474

Please sign in to comment.