Skip to content

Commit

Permalink
Create consumer-main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
HyejiYu authored Sep 23, 2024
1 parent 5940830 commit 94a525d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/consumer-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI/CD for MQ consumers

on:
push:
paths:
- "messagequeue/consumer/homeplus_consumer.py"
- "messagequeue/consumer/oasis_consumer.py"
- "posty/consumer/posty_consumer.py"
branches:
- main # 원하는 브랜치로 설정 가능

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install rsync # rsync 설치 단계 추가
run: sudo apt-get update && sudo apt-get install -y rsync

- name: Transfer DAG file to GCE
env:
GCE_IP: ${{ secrets.GCE_IP }}
GCE_USER: ${{ secrets.GCE_USER }}
GCE_SSH_PRIVATE_KEY: ${{ secrets.GCE_SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "${GCE_SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./messagequeue/consumer/homeplus_consumer.py ${GCE_USER}@${GCE_IP}:/home/patturning1/homeplus_consumer.py
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./messagequeue/consumer/oasis_consumer.py ${GCE_USER}@${GCE_IP}:/home/patturning1/oasis_consumer.py
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./messagequeue/consumer/posty_consumer.py ${GCE_USER}@${GCE_IP}:/home/patturning1/posty_consumer.py

0 comments on commit 94a525d

Please sign in to comment.