Skip to content

Commit

Permalink
feat: cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
a2cd committed Jan 15, 2024
1 parent aa2f2da commit a9e0fec
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,14 @@ jobs:
IdentityFile ~/.ssh/$KEY_FILE
StrictHostKeyChecking no
END
- name: Run git pull
# 从github pull代码,失败重试3次
run: |
ssh a2cd "cd /usr/local/repo/rs-hello-world/ && \
git pull origin main || \
(echo 'git pull retry: 1/3' && git pull origin main) || \
(echo 'git pull retry: 2/3' && git pull origin main) || \
(echo 'git pull retry: 3/3' && git pull origin main) || \
(echo 'git pull failed' && exit 1)"
- name: Run deploy
run: ssh a2cd 'cd /usr/local/repo/rs-hello-world/ && git pull origin main && docker-compose pull && docker-compose up -d'
run: ssh a2cd 'docker-compose pull && docker-compose up -d'

0 comments on commit a9e0fec

Please sign in to comment.