Skip to content

Create deploy.yml

Create deploy.yml #7

Workflow file for this run

name: Deploy
on:
push:
branches: [ master ]
jobs:
Deploy:
name: CI/CD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build & Deploy
env:
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
HOSTNAME: ${{secrets.SSH_HOST}}
USER_NAME: ${{secrets.USER_NAME}}
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} << 'EOF'
echo "Success Connection!"
pwd
cd ${HOME_DIR}
pwd
python3 cicd-frontend.py
EOF
rm -f private_key
echo "Success Deployed!"