-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: 發布angular | ||
|
||
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/demo # Angular 应用程序的构建输出目录 | ||
CLEAN: true # 可选项,是否清除目标分支的其他文件,默认为 true |