new instance GitActions test4 #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --fix-missing && sudo apt-get install -y rsync | |
- name: Set up SSH and transfer files | |
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 # SSH 키 권한 설정 | |
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./airflow/HomePlus_dag.py ${GCE_USER}@${GCE_IP}:/home/patturning2/airflow/dags/HomePlus_dag.py | |
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./airflow/Oasis_dag.py ${GCE_USER}@${GCE_IP}:/home/patturning2/airflow/dags/Oasis_dag.py | |
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./airflow/Posty_dag.py ${GCE_USER}@${GCE_IP}:/home/patturning2/airflow/dags/Posty_dag.py | |