-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 1.37 KB
/
Copy pathnode.js.yml
File metadata and controls
55 lines (48 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Node.js CI/CD
on:
push:
branches: [ "master_" ]
pull_request:
branches: [ "master_" ]
permissions:
contents: write # This gives the GITHUB_TOKEN permission to push to gh-pages
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.15.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
# - run: npm test
deploy:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 12.15.0
uses: actions/setup-node@v4
with:
node-version: 12.15.0
cache: 'npm'
- name: Install Angular CLI
run: npm install --global @angular/cli@9.0.1
- name: Install dependencies
run: npm ci
- name: Build Angular project
run: ng build --prod
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/todo
keep_files: false # Cleans previous deployment