File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1+ # GitHub Actions Workflow for Deploying Website
2+
13name : Deploy Website
24
35on :
@@ -14,14 +16,10 @@ jobs:
1416
1517 - name : Set up SSH Agent
1618 run : |
17- eval "$(ssh-agent -s)"
18- echo "${{ secrets.DEPLOY_KEY }}" | tr -d '\r' | ssh-add -
19- ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
20- ssh-add -l
21- echo "SSH key added successfully."
22-
23- - name : Verify SSH Connection
24- run : ssh -o StrictHostKeyChecking=no -T git@github.com || exit 1
19+ eval "$(ssh-agent -s)" # Start SSH agent
20+ echo "${{ secrets.DEPLOY_KEY }}" | ssh-add - # Add private key
21+ env :
22+ DEPLOY_KEY : ${{ secrets.DEPLOY_KEY }}
2523
2624 - name : Deploy to Namecheap Server
2725 uses : appleboy/ssh-action@v0.1.4
3129 username : ${{ secrets.SERVER_USERNAME }}
3230 key : ${{ secrets.DEPLOY_KEY }}
3331 script : |
32+ eval "$(ssh-agent -s)"
33+ ssh-add ~/.ssh/new_repo_key
3434 cd ~/public_html/
3535 git pull origin main
3636 echo "Deployment successful!"
You can’t perform that action at this time.
0 commit comments