Update index.html #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: kenan actions | |
on: | |
push: | |
branches: [ "main" ] | |
# Environment variables available to all jobs and steps in this workflow | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: node install | |
uses: actions/[email protected] | |
with: | |
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. | |
node-version: "20.X" # optional | |
- name: INSTALL NODE MODULES | |
run: npm i | |
- name: Build | |
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 server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
password: ${{ secrets.REMOTE_PASS }} | |
port: ${{ secrets.REMOTE_PORT }} | |
script: | | |
git config pull.rebase false # 这种策略会创建一个新的合并提交,将本地和远程的更改合并在一起。 | |
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/' |