Skip to content

Commit

Permalink
[CHORE] 운영 서버 workflow 작성 및 개발 서버 workflow 파일 이름 변경 (#145)
Browse files Browse the repository at this point in the history
* rename: docker-deploy.yml -> dev-deploy.yml

* chore: 운영 환경 workflow 파일 작성
  • Loading branch information
injae-348 authored Sep 11, 2024
1 parent aec89d5 commit 3012a1f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
File renamed without changes.
46 changes: 46 additions & 0 deletions .github/workflows/prod-deploy.yml
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

0 comments on commit 3012a1f

Please sign in to comment.