-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHORE] 운영 서버 workflow 작성 및 개발 서버 workflow 파일 이름 변경 (#145)
* rename: docker-deploy.yml -> dev-deploy.yml * chore: 운영 환경 workflow 파일 작성
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Prod CI/CD | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "production" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'corretto' | ||
|
||
- name: Build with Gradle | ||
run: | | ||
chmod +x ./gradlew | ||
./gradlew clean build -x test | ||
- name: Build the Docker image | ||
run: | | ||
docker login -u ${{ secrets.PROD_DOCKER_USERNAME }} -p ${{ secrets.PROD_DOCKER_PASSWORD }} | ||
docker build -f Dockerfile -t ${{ secrets.PROD_DOCKER_REPO }} . | ||
docker push ${{ secrets.PROD_DOCKER_REPO }} | ||
- name: Deploy to server | ||
uses: appleboy/ssh-action@master | ||
id: deploy | ||
with: | ||
host: ${{ secrets.PROD_HOST }} | ||
username: ${{ secrets.PROD_USERNAME }} | ||
key: ${{ secrets.PROD_KEY }} | ||
envs: GITHUB_SHA | ||
script: | | ||
cd ./buddies | ||
bash deploy.sh |