Update .forgejo/workflows/Run_pull.yaml
Some checks failed
Deploy to server / deploy (push) Failing after 18s
Some checks failed
Deploy to server / deploy (push) Failing after 18s
This commit is contained in:
parent
24306c4af0
commit
9c1e79b0e3
|
@ -1,21 +1,26 @@
|
|||
name: Deploy to server
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
run_pull:
|
||||
name: run pull
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
steps:
|
||||
- name: install ssh keys
|
||||
run: |
|
||||
install -m 600 -D /dev/null ~/.ssh/id_rsa
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
|
||||
- name: connect and pull
|
||||
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git checkout ${{ secrets.MAIN_BRANCH }} && git pull && exit"
|
||||
- name: cleanup
|
||||
run: rm -rf ~/.ssh
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure SSH
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
|
||||
|
||||
- name: Git Pull
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
ssh-keyscan -t rsa ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
|
||||
ssh ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} "cd ${{ secrets.REPO_PATH }} && git pull origin main"
|
||||
echo "Successfully pulled repo."
|
Loading…
Reference in a new issue