chore: Updated ssh_test.yml for deployment testing #2
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: deploy | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: | |
- main | |
jobs: | |
SSH: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: ssh to vm | |
uses: appleboy/ssh-action@master | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} # 내가 변수로 저장한 pem key | |
host: ${{ secrets.SSH_HOST }} # 내가 변수로 저장한 ip | |
username: ${{ secrets.SSH_USER }} # 내가 변수로 저장한 User | |
script: | | |
echo "hello world" | |
echo "hello world2" | |
docker run hello-world | |
# 깃허브 레파지토리가 프라이빗으로 만들어져 있을때. | |
# git pull https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PASSWORD }}@github.com/blockenters/streamlit_kmeans.git | |
# https://velog.io/@wonjun12/AWS-EC2%EC%99%80-Github-Actions-%EC%97%B0%EB%8F%99 참고 |