Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions .github/workflows/cd-dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,42 @@ on:

permissions:
contents: read
packages: read # 배포 서버에서 pull만 하면 read면 충분
packages: read

concurrency:
group: dev-deploy
cancel-in-progress: true

env:
APP_NAME: book-preprocessing-worker
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
APP_PORT: 9002

jobs:
deploy:
# ✅ CI 성공 + dev 브랜치에서만
if: >
${{
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'dev'
}}
runs-on: ubuntu-latest

steps:
- name: Deploy to dev server
uses: appleboy/ssh-action@v1.0.3
env:
# CI에서 푸시된 커밋 sha = head_sha
VERSION: dev-${{ github.event.workflow_run.head_sha }}
IMAGE_TAG: dev-${{ github.event.workflow_run.head_sha }}
APP_NAME: ${{ env.APP_NAME }}
APP_PORT: ${{ env.APP_PORT }}
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GHCR_USER: ${{ github.actor }}
APP_PORT: ${{ env.APP_PORT }}
with:
host: ${{ secrets.DEV_REMOTE_IP }}
username: ubuntu
key: ${{ secrets.DEV_REMOTE_PRIVATE_KEY }}
port: ${{ secrets.DEV_REMOTE_SSH_PORT }}
envs: VERSION,APP_NAME,GHCR_TOKEN,GHCR_USER,APP_PORT
envs: IMAGE_TAG,APP_NAME,APP_PORT,GHCR_TOKEN,GHCR_USER
script: |
set -euo pipefail
set -e
cd /home/ubuntu/app/${APP_NAME}
echo "$GHCR_TOKEN" | sudo docker login ghcr.io -u "$GHCR_USER" --password-stdin
chmod +x deploy.sh
./deploy.sh
echo "$GHCR_TOKEN" | docker login ghcr.io -u "$GHCR_USER" --password-stdin
./deploy.sh
6 changes: 1 addition & 5 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,4 @@ jobs:
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/build/test-results/test/*.xml'




report_paths: '**/build/test-results/test/*.xml'