Update .forgejo/workflows/Run_pull.yaml
Some checks failed
Deploy to server / deploy (push) Failing after 18s

This commit is contained in:
Maksim Bengraf 2024-07-12 22:20:48 +00:00
parent 24306c4af0
commit 9c1e79b0e3

View file

@ -1,21 +1,26 @@
name: Deploy to server
on: on:
push: push:
branches: branches:
- main - main
workflow_dispatch:
jobs: jobs:
run_pull: deploy:
name: run pull
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: install ssh keys - 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: | run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa cd ${{ github.workspace }}
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa ssh-keyscan -t rsa ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts ssh ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} "cd ${{ secrets.REPO_PATH }} && git pull origin main"
- name: connect and pull echo "Successfully pulled repo."
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