[docs] workflow 수정 #3
This file contains hidden or 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: CD to EC2 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Add SSH key | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_rsa | |
| chmod 600 ~/.ssh/id_rsa | |
| ssh-keyscan -H ${{ secrets.EC2_HOST }} >> ~/.ssh/known_hosts | |
| - name: Deploy with SSH | |
| run: | | |
| ssh ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} << 'EOF' | |
| set -e | |
| for dir in http1 http2 http3; do | |
| cd ~/HTTP-Version-Test/docker/$dir/static | |
| # Git pull or clone if not yet | |
| if [ ! -d ".git" ]; then | |
| git clone https://github.com/${{ github.repository }} . | |
| else | |
| git pull origin main | |
| fi | |
| done | |
| EOF |