Skip to content

Feat: add save-text api #4

Feat: add save-text api

Feat: add save-text api #4

Workflow file for this run

name: CI/CD for Airflow DAGs
on:
push:
paths:
- "airflow/HomePlus_dag.py"
- "airflow/Oasis_dag.py"
- "airflow/requirements/modules.py"
- "airflow/requirements/packages.py"
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Clean apt-get cache # rsync 설치 단계
run: sudo apt-get update --fix-missing
- name: Install rsync
run: |
sudo apt-get install rsync
- name: check if rsync is installed
run: which rsync
- name: Add /usr/bin to PATH
run: echo 'export PATH="/usr/bin:$PATH"' >> $GITHUB_ENV
- 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 }}
GCE_AIRFLOW_HOME: ${{ secrets.GCE_AIRFLOW_HOME }}
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}:${GCE_AIRFLOW_HOME}/dags/HomePlus_dag.py
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./airflow/Oasis_dag.py ${GCE_USER}@${GCE_IP}:${GCE_AIRFLOW_HOME}/dags/Oasis_dag.py
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./airflow/requirements/modules.py ${GCE_USER}@${GCE_IP}:${GCE_AIRFLOW_HOME}/dags/requirements/modules.py
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./airflow/requirements/packages.py ${GCE_USER}@${GCE_IP}:${GCE_AIRFLOW_HOME}/dags/requirements/packages.py