Skip to content

chore: cd pipeline 변경 #37

chore: cd pipeline 변경

chore: cd pipeline 변경 #37

Workflow file for this run

name: CD Pipeline
on:
pull_request:
branches:
- 'main'
types: [ closed ]
push:
branches:
- 'main'
concurrency:
group: xclone-dev-cd
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: DockerHub Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create application.properties from secret
run: |
mkdir -p src/main/resources
echo "${{ secrets.APPLICATION_PROPERTIES }}" | base64 --decode > src/main/resources/application.properties
- name: Build and push Docker image
run: |
docker build -t kimjooyoung/xclone-backend-dev:latest .
docker push kimjooyoung/xclone-backend-dev:latest
- name: Deploy to EC2
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
port: 22
script: |
cd /home/ubuntu/xclone
sudo ./deploy.sh