File tree Expand file tree Collapse file tree 5 files changed +23
-14
lines changed
Expand file tree Collapse file tree 5 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 11on :
2+ workflow_dispatch : {}
23 push :
34 # Sequence of patterns matched against refs/tags
45 tags :
@@ -38,13 +39,21 @@ jobs:
3839 with :
3940 name : sqlpage ${{ matrix.os }}
4041 path : ${{ matrix.binary_path }}
42+ build-aws :
43+ runs-on : ubuntu-latest
44+ steps :
45+ - uses : actions/checkout@v3
46+ - run : docker build -t sqlpage-lambda-builder . -f lambda.Dockerfile --target builder
47+ - run : docker run sqlpage-lambda-builder cat deploy.zip > sqlpage-aws-lambda.zip
48+ - uses : actions/upload-artifact@v3
49+ with :
50+ name : sqlpage aws lambda serverless image
51+ path : sqlpage-aws-lambda.zip
4152 create_release :
4253 name : Create Release
43- needs : build
54+ needs : [ build, build-aws]
4455 runs-on : ubuntu-latest
4556 steps :
46- - name : Checkout code
47- uses : actions/checkout@v3
4857 - uses : actions/download-artifact@v3
4958 - run : |
5059 chmod +x sqlpage*/sqlpage;
6372 files : |
6473 sqlpage windows-latest/sqlpage-windows.zip
6574 sqlpage-linux.tgz
66- sqlpage-macos.tgz
75+ sqlpage-macos.tgz
76+ sqlpage aws lambda serverless image/sqlpage-aws-lambda.zip
Original file line number Diff line number Diff line change 11[package ]
22name = " sqlpage"
3- version = " 0.7.1 "
3+ version = " 0.7.2 "
44edition = " 2021"
55description = " A SQL-only web application framework. Takes .sql files and formats the query result using pre-made configurable professional-looking components."
66keywords = [" web" , " sql" , " framework" ]
Original file line number Diff line number Diff line change @@ -135,10 +135,11 @@ An easy way to do so is using the provided docker image:
135135
136136``` bash
137137 docker build -t sqlpage-lambda-builder . -f lambda.Dockerfile --target builder
138- docker run sqlpage-lambda-builder cat deploy.zip > deploy .zip
138+ docker run sqlpage-lambda-builder cat deploy.zip > sqlpage-aws-lambda .zip
139139```
140140
141- You can then use ` deploy.zip ` as the source for an AWS Lambda,
141+ You can then just add your own SQL files to ` sqlpage-aws-lambda.zip ` ,
142+ and [ upload it to AWS Lambda] ( https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip ) ,
142143selecting * Custom runtime on Amazon Linux 2* as a runtime.
143144
144145### Hosting sql files directly inside the database
Original file line number Diff line number Diff line change @@ -456,15 +456,13 @@ pub fn create_app(
456456pub async fn run_server ( config : Config , state : AppState ) -> anyhow:: Result < ( ) > {
457457 let listen_on = config. listen_on ;
458458 let state = web:: Data :: new ( state) ;
459+ let factory = move || create_app ( web:: Data :: clone ( & state) ) ;
459460
460461 #[ cfg( feature = "lambda-web" ) ]
461462 if lambda_web:: is_running_on_lambda ( ) {
462463 lambda_web:: run_actix_on_lambda ( factory) . await ?;
463464 return Ok ( ( ) ) ;
464465 }
465- HttpServer :: new ( move || create_app ( web:: Data :: clone ( & state) ) )
466- . bind ( listen_on) ?
467- . run ( )
468- . await ?;
466+ HttpServer :: new ( factory) . bind ( listen_on) ?. run ( ) . await ?;
469467 Ok ( ( ) )
470468}
You can’t perform that action at this time.
0 commit comments