-
Notifications
You must be signed in to change notification settings - Fork 5
35 lines (29 loc) · 1.19 KB
/
dag-actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: CI/CD for Airflow DAGs
on:
push:
paths:
- "airflow/HomePlus_dag.py"
- "airflow/Oasis_dag.py"
- "airflow/Posty_dag.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" ./airflow/HomePlus_dag.py ${GCE_USER}@${GCE_IP}:/home/patturning1/airflow/dags/HomePlus_dag.py
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./airflow/Oasis_dag.py ${GCE_USER}@${GCE_IP}:/home/patturning1/airflow/dags/Oasis_dag.py
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./airflow/Posty_dag.py ${GCE_USER}@${GCE_IP}:/home/patturning1/airflow/dags/Posty_dag.py