Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kenanaptx4869 authored Sep 12, 2024
1 parent 76f45da commit c19bf23
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
# Environment variables available to all jobs and steps in this workflow

permissions:
contents: read
contents: write

jobs:
build:
Expand All @@ -33,21 +33,33 @@ jobs:
run: npm run build


# - name: Deploy to GitHub Pages
# uses: JamesIves/github-pages-deploy-action@v4
# if: ${{ github.ref == 'refs/heads/main' }}
# with:
# branch: gh-pages//这个是存储你项目打包后的文件分支
# folder: dist
# # token: ${{ secrets.TOKEN }}
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
# if: ${{ github.ref == 'refs/heads/main' }}
with:
branch: gh-pages # 这个是存储你项目打包后的文件分支
folder: dist
# token: ${{ secrets.TOKEN }}


- name: copy dist file with scp
uses: appleboy/scp-action@v0.0.1
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
password: ${{ secrets.REMOTE_PASS }}
port: 22
source: 'dist/'
target: '/www/wwwroot/8.152.0.253/something0408/'
port: ${{ secrets.REMOTE_PORT }}
script: |
cd /www/wwwroot/8.152.0.253/something0408 # 替换为您的项目在服务器上的位置
git pull origin gh-pages # 拉取最新代码
# - name: copy dist file with scp
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.REMOTE_HOST }}
# username: ${{ secrets.REMOTE_USER }}
# password: ${{ secrets.REMOTE_PASS }}
# port: 22
# source: 'dist/'
# target: '/www/wwwroot/8.152.0.253/something0408/'

0 comments on commit c19bf23

Please sign in to comment.