Merge branch 'master' of https://github.com/bishshi/myblogsource
This commit is contained in:
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@@ -3,7 +3,7 @@ name: 自动部署
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- master
|
||||||
|
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
@@ -64,18 +64,18 @@ jobs:
|
|||||||
git add .
|
git add .
|
||||||
git commit -m "${{ github.event.head_commit.message }}··[$(date +"%Z %Y-%m-%d %A %H:%M:%S")]"
|
git commit -m "${{ github.event.head_commit.message }}··[$(date +"%Z %Y-%m-%d %A %H:%M:%S")]"
|
||||||
git push --force --quiet "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" master:page
|
git push --force --quiet "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" master:page
|
||||||
|
|
||||||
- name: 服务器执行拉取命令
|
- name: 服务器执行拉取命令
|
||||||
uses: appleboy/ssh-action@v1
|
uses: appleboy/ssh-action@v1
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.SERVER_IP }}
|
host: ${{ secrets.SERVER_IP }}
|
||||||
username: ${{ secrets.USERNAME }}
|
username: ${{ secrets.USERNAME }}
|
||||||
key: ${{ secrets.KEY }}
|
password: ${{ secrets.PASSWORD }}
|
||||||
passphrase: ${{ secrets.PASSPHRASE }}
|
|
||||||
port: ${{ secrets.PORT }}
|
port: ${{ secrets.PORT }}
|
||||||
script: |
|
script: |
|
||||||
cd /opt/1panel/www/sites/blog.biss.click/index/
|
cd /opt/1panel/www/sites/blog.biss.click/index/
|
||||||
git config --global --add safe.directory "$(pwd)"
|
git config --global --add safe.directory "$(pwd)"
|
||||||
git fetch --all --depth=1
|
git fetch --all --depth=1
|
||||||
git reset --hard origin/main
|
git reset --hard origin/page
|
||||||
git pull --depth=1
|
git pull --depth=1
|
||||||
echo "✅ 已拉取 page 分支最新内容"
|
echo "✅ 已拉取 page 分支最新内容"
|
||||||
|
|||||||
Reference in New Issue
Block a user