github pages

1、创建repositorie

 2、创建一个简单的index.html文件:

 3、配置pages:

 4、查看action部署状态:

 

 

 查看每个步骤的状态

5、部署完成后:

 就会出现固定的域名访问路径:

 将如下vue代码进行pages发布:

 配置自动https://github.com/jsonhc/jsonhcdev/blob/main/.github/workflows/static.yml

name: Deploy to GitHub Pages
 
on:
  push:
    branches:
      - main
 
jobs:
  build:
    runs-on: ubuntu-latest
 
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
 
    - name: Use Node.js
      uses: actions/setup-node@v4
      with:
        node-version: '22'
 
    - name: Install dependencies
      run: npm install
 
    - name: Build
      run: npm run build
 
    - name: Deploy to GitHub Pages
      uses: peaceiris/actions-gh-pages@v4
      with:
        github_token: ${{ secrets.GH_PAGES_TOKEN }}
        publish_dir: ./dist

 创建token:在个人 setting 中找到 developer setting

 将token配置到变量:

 配置完成后,自动部署,将产物deploy到gh-pages分支:

 再配置pages从branch发布:

 github通过两次cicd:

 访问域名:

 

posted on 2025-07-22 23:34  wadeson  阅读(25)  评论(0)    收藏  举报