Skip to content

Commit bcd7d3b

Browse files
committed
build: added action to deploy
1 parent 7cb40f9 commit bcd7d3b

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/main.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Angular Build and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 20
19+
20+
- name: Build Angular app to prod
21+
run: npm install && npm run build:prod
22+
23+
- name: Deploy to GitHub Pages
24+
uses: JamesIves/github-pages-deploy-action@v4
25+
with:
26+
folder: dist/browser
27+
branch: prod
28+
token: ${{ secrets.GH_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"ng": "ng",
66
"start": "ng serve",
77
"build": "ng build",
8+
"build:prod": "ng build --configuration=production --base-href=/material-playground/",
89
"watch": "ng build --watch --configuration development",
910
"test": "ng test"
1011
},

0 commit comments

Comments
 (0)