赞
踩
Github地址:https://github.com/ling08140814/myCarousel
访问地址:https://ling08140814.github.io/myCarousel/
"homepage": "https://<Github用户名>.github.io/<Github仓库名>"
举例:
"homepage": "https://ling08140814.github.io/myCarousel"
base: "/<Github仓库名>/"
举例:
base: "/myCarousel/"
5.1 新建workflow
5.2 选择workflow
5.3 打开之后,将.yml默认内容进行替换,然后commit
替换内容:
name: GitHub Actions Build and Deploy Demo # 大标题 on: push: branches: - master # 监听哪个分支的哪个动作 permissions: contents: write # 设置权限,可写,也可以不用配置,v4版本新增的 jobs: build-and-deploy: # 其中一个任务的名称,ID runs-on: ubuntu-latest # 这个任务运行所需的环境 steps: - name: Checkout # 第一步:获取源码 uses: actions/checkout@v3 # 使用的工具 - name: Install and Build # 第二步:下载依赖和构建 run: | npm install npm run build - name: Deploy # 第三步:部署 uses: JamesIves/github-pages-deploy-action@v4 with: folder: dist # 部署的目录 branch: deploy # 部署到哪个分支
5.4 commit之后,会自动构建,构建成功后展示如下内容
部署分支和.yml里的部署分支保持一致
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。