Skip to content

Commit 7907eda

Browse files
committed
ci: add github actions deploy workflow
1 parent 2660727 commit 7907eda

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Configure SSH
18+
run: |
19+
mkdir -p ~/.ssh
20+
echo "${{ secrets.DEPLOY_SERVER_PRIVATE_KEY }}" > ~/.ssh/id_rsa
21+
chmod 600 ~/.ssh/id_rsa
22+
ssh-keyscan -H "${{ secrets.DEPLOY_HOST }}" >> ~/.ssh/known_hosts
23+
24+
- name: Push to server
25+
run: |
26+
git remote add deploy ${{ secrets.DEPLOY_REMOTE }}
27+
git push deploy main:master --force

0 commit comments

Comments
 (0)