File tree 7 files changed +150
-16
lines changed
7 files changed +150
-16
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy to Netlify Hosting on merge
2
+ " on " :
3
+ push :
4
+ branches :
5
+ - master
6
+ jobs :
7
+ build_and_deploy :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - uses : actions/checkout@v3
11
+ - run : npm ci && npm run build:ssr
12
+ - uses : nwtgck/actions-netlify@v2
13
+ with :
14
+ publish-dir : " ./dist/angular-signals-database/browser"
15
+ production-branch : master
16
+ production-deploy : true
17
+ github-token : ${{ secrets.GITHUB_TOKEN }}
18
+ deploy-message : " Deploy from GitHub Actions"
19
+ netlify-config-path : " ./netlify.toml"
20
+ env :
21
+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
22
+ NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
Original file line number Diff line number Diff line change
1
+ name : Deploy to Netlify Hosting on PR
2
+ " on " : pull_request
3
+ jobs :
4
+ build_and_preview :
5
+ if : " ${{ github.event.pull_request.head.repo.full_name == github.repository }}"
6
+ runs-on : ubuntu-latest
7
+ steps :
8
+ - uses : actions/checkout@v3
9
+ - run : npm ci && npm run build:ssr
10
+ - uses : nwtgck/actions-netlify@v2
11
+ with :
12
+ publish-dir : " ./dist/angular-signals-database/browser"
13
+ production-branch : master
14
+ github-token : ${{ secrets.GITHUB_TOKEN }}
15
+ deploy-message : " Deploy from GitHub Actions"
16
+ enable-pull-request-comment : true
17
+ enable-commit-comment : true
18
+ overwrites-pull-request-comment : true
19
+ netlify-config-path : " ./netlify.toml"
20
+ env :
21
+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
22
+ NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
Original file line number Diff line number Diff line change 1
1
[[redirects ]]
2
2
from = " /*"
3
- to = " /index.html "
3
+ to = " /.netlify/functions/start "
4
4
status = 200
5
-
5
+
6
+ [build ]
7
+ command = " ng build --configuration production && npm run copy:files"
8
+ publish = " netlify/functions/"
9
+
10
+ [functions ]
11
+ included_files = [" dist/**" ]
Original file line number Diff line number Diff line change
1
+ const serverless = require ( 'serverless-http' ) ;
2
+ const { app } = require ( "./dist/angular-signals-database/server/main" ) ;
3
+
4
+ exports . handler = serverless ( ( app ) ) ;
Original file line number Diff line number Diff line change 7
7
"build" : " ng build" ,
8
8
"watch" : " ng build --watch --configuration development" ,
9
9
"test" : " ng test" ,
10
+ "test:ci" : " ng test --no-watch --no-progress --browsers=ChromeHeadlessCI" ,
10
11
"dev:ssr" : " ng run angular-signals-database:serve-ssr" ,
11
12
"serve:ssr" : " node dist/angular-signals-database/server/main.js" ,
13
+ "copy:files" : " node ./scripts/copyFiles.js" ,
12
14
"build:ssr" : " ng build && ng run angular-signals-database:server" ,
13
15
"prerender" : " ng run angular-signals-database:prerender"
14
16
},
25
27
"@angular/platform-browser-dynamic" : " ^16.1.2" ,
26
28
"@angular/platform-server" : " ^16.1.2" ,
27
29
"@angular/router" : " ^16.1.2" ,
30
+ "@netlify/functions" : " ^1.6.0" ,
28
31
"@nguniversal/express-engine" : " ^16.1.0" ,
29
32
"express" : " ^4.15.2" ,
33
+ "fs-extra" : " ^11.1.1" ,
30
34
"rxjs" : " ~7.8.1" ,
35
+ "serverless-http" : " ^3.2.0" ,
31
36
"tslib" : " ^2.5.3" ,
32
37
"zone.js" : " ~0.13.1"
33
38
},
47
52
"karma-jasmine-html-reporter" : " ~2.1.0" ,
48
53
"typescript" : " ~5.0.3"
49
54
}
50
- }
55
+ }
Original file line number Diff line number Diff line change
1
+ const fs = require ( "fs-extra" ) ;
2
+
3
+ ( async ( ) => {
4
+ const src = "./dist" ;
5
+ const copy = "./netlify/functions/dist" ;
6
+
7
+ await fs . remove ( copy ) ;
8
+ await fs . copy ( src , copy ) ;
9
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments