Skip to content

Commit dd717ba

Browse files
committed
ci: improve workflow - add cache, Node 24, cleaner steps
1 parent edf52d9 commit dd717ba

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,42 @@ name: Build and test
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, big-update]
66

77
jobs:
8-
build-and-deploy:
8+
build-test-and-deploy:
99
runs-on: ubuntu-latest
1010

1111
steps:
1212
- uses: actions/checkout@v4
13+
1314
- uses: actions/setup-node@v4
1415
with:
15-
node-version: 22
16+
node-version: 24
17+
cache: npm
18+
cache-dependency-path: src/package-lock.json
1619

17-
- name: Prepare
20+
- name: Build and test
21+
working-directory: src
1822
run: |
19-
cd src
20-
npm install
23+
npm ci
2124
npm run build
2225
npm run test
23-
cd dist
24-
npm link
25-
cd ..
26-
cd ..
26+
27+
- name: Verify ng add works
28+
run: |
29+
cd src/dist && npm link && cd ../..
2730
npm install -g @angular/cli
28-
ng new your-angular-project --defaults
29-
cd your-angular-project
31+
ng new test-app --defaults
32+
cd test-app
3033
npm link angular-cli-ghpages
3134
ng add angular-cli-ghpages
3235
3336
# CI test only: Verifies that the gh-pages branch gets updated
3437
# This is NOT a production deployment - there is no public website for angular-cli-ghpages
3538
- name: Deploy
3639
if: github.ref == 'refs/heads/main'
40+
working-directory: test-app
3741
env:
3842
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
run: |
40-
cd your-angular-project
41-
ng deploy --name="The Buildbot" --email="buildbot@angular2buch.de" --cname=angular-cli-ghpages.angular.schule
43+
run: ng deploy --name="The Buildbot" --email="buildbot@angular2buch.de" --cname=angular-cli-ghpages.angular.schule

0 commit comments

Comments
 (0)