Merge pull request #4 from ai4agi/dev #1
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: Actions CI - Next.js version 12 static site export, GitHub Actions Build and Deploy | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 获取源码 ️ | |
uses: actions/checkout@v3 | |
- name: Node环境版本 ️ | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'yarn' # 启用Yarn缓存 | |
- name: 安装依赖 ⚙️ | |
run: yarn install | |
- name: 打包 ️ | |
run: | | |
yarn build | |
yarn next export # 增加这一行来导出静态网站 | |
touch out/.nojekyll | |
- name: 部署 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: out | |
clean: true |