Update node.js.yml #18
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: Build and Deploy Angular App | |
on: | |
push: | |
branches: | |
- main # 触发部署的分支,可以根据实际情况调整 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' # 使用的 Node.js 版本 | |
- name: Install Angular CLI | |
run: npm install -g @angular/cli | |
- name: Install dependencies | |
run: npm install | |
- name: Build Angular app | |
run: ng build --configuration=production | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages # 要部署到的分支,比如 gh-pages | |
FOLDER: dist # Angular 应用程序的构建输出目录 | |
CLEAN: true # 可选项,是否清除目标分支的其他文件,默认为 true |