mirror of
https://github.com/Lissy93/web-check.git
synced 2025-04-30 12:24:27 +02:00
Automate deployment to AWS lambda (cheaper than Netlify)
This commit is contained in:
parent
6d8b2368e7
commit
394b68fa29
37
.github/workflows/deploy-aws.yml
vendored
Normal file
37
.github/workflows/deploy-aws.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
name: 🚀 Deploy to AWS
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
paths:
|
||||||
|
- api/**
|
||||||
|
- serverless.yml
|
||||||
|
- package.json
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy-api:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
|
||||||
|
- name: Install Serverless CLI and dependencies
|
||||||
|
run: |
|
||||||
|
yarn add -g serverless
|
||||||
|
yarn
|
||||||
|
- name: Deploy to AWS
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
run: serverless deploy
|
||||||
|
|
266
serverless.yml
266
serverless.yml
@ -6,35 +6,17 @@ provider:
|
|||||||
region: us-east-1
|
region: us-east-1
|
||||||
|
|
||||||
functions:
|
functions:
|
||||||
dnssec:
|
archives:
|
||||||
handler: api/dnssec.handler
|
handler: api/archives.handler
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: api/dnssec
|
path: api/archives
|
||||||
method: get
|
method: get
|
||||||
linkedPages:
|
blockLists:
|
||||||
handler: api/linked-pages.handler
|
handler: api/block-lists.handler
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: api/linked-pages
|
path: api/block-lists
|
||||||
method: get
|
|
||||||
robotsTxt:
|
|
||||||
handler: api/robots-txt.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/robots-txt
|
|
||||||
method: get
|
|
||||||
ssl:
|
|
||||||
handler: api/ssl.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/ssl
|
|
||||||
method: get
|
|
||||||
whois:
|
|
||||||
handler: api/whois.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/whois
|
|
||||||
method: get
|
method: get
|
||||||
carbon:
|
carbon:
|
||||||
handler: api/carbon.handler
|
handler: api/carbon.handler
|
||||||
@ -42,138 +24,206 @@ functions:
|
|||||||
- http:
|
- http:
|
||||||
path: api/carbon
|
path: api/carbon
|
||||||
method: get
|
method: get
|
||||||
features:
|
|
||||||
handler: api/features.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/features
|
|
||||||
method: get
|
|
||||||
mailConfig:
|
|
||||||
handler: api/mail-config.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/mail-config
|
|
||||||
method: get
|
|
||||||
screenshot:
|
|
||||||
handler: api/screenshot.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/screenshot
|
|
||||||
method: get
|
|
||||||
status:
|
|
||||||
handler: api/status.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/status
|
|
||||||
method: get
|
|
||||||
cookies:
|
cookies:
|
||||||
handler: api/cookies.handler
|
handler: api/cookies.handler
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: api/cookies
|
path: api/cookies
|
||||||
method: get
|
method: get
|
||||||
getIp:
|
|
||||||
handler: api/get-ip.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/get-ip
|
|
||||||
method: get
|
|
||||||
ports:
|
|
||||||
handler: api/ports.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/ports
|
|
||||||
method: get
|
|
||||||
securityTxt:
|
|
||||||
handler: api/security-txt.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/security-txt
|
|
||||||
method: get
|
|
||||||
techStack:
|
|
||||||
handler: api/tech-stack.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/tech-stack
|
|
||||||
method: get
|
|
||||||
dnsServer:
|
dnsServer:
|
||||||
handler: api/dns-server.handler
|
handler: api/dns-server.handler
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: api/dns-server
|
path: api/dns-server
|
||||||
method: get
|
method: get
|
||||||
headers:
|
|
||||||
handler: api/headers.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/headers
|
|
||||||
method: get
|
|
||||||
quality:
|
|
||||||
handler: api/quality.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/quality
|
|
||||||
method: get
|
|
||||||
sitemap:
|
|
||||||
handler: api/sitemap.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/sitemap
|
|
||||||
method: get
|
|
||||||
traceRoute:
|
|
||||||
handler: api/trace-route.handler
|
|
||||||
events:
|
|
||||||
- http:
|
|
||||||
path: api/trace-route
|
|
||||||
method: get
|
|
||||||
dns:
|
dns:
|
||||||
handler: api/dns.handler
|
handler: api/dns.handler
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: api/dns
|
path: api/dns
|
||||||
method: get
|
method: get
|
||||||
|
dnssec:
|
||||||
|
handler: api/dnssec.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/dnssec
|
||||||
|
method: get
|
||||||
|
features:
|
||||||
|
handler: api/features.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/features
|
||||||
|
method: get
|
||||||
|
firewall:
|
||||||
|
handler: api/firewall.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/firewall
|
||||||
|
method: get
|
||||||
|
getIp:
|
||||||
|
handler: api/get-ip.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/get-ip
|
||||||
|
method: get
|
||||||
|
headers:
|
||||||
|
handler: api/headers.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/headers
|
||||||
|
method: get
|
||||||
hsts:
|
hsts:
|
||||||
handler: api/hsts.handler
|
handler: api/hsts.handler
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: api/hsts
|
path: api/hsts
|
||||||
method: get
|
method: get
|
||||||
|
httpSecurity:
|
||||||
|
handler: api/http-security.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/http-security
|
||||||
|
method: get
|
||||||
|
legacyRank:
|
||||||
|
handler: api/legacy-rank.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/legacy-rank
|
||||||
|
method: get
|
||||||
|
linkedPages:
|
||||||
|
handler: api/linked-pages.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/linked-pages
|
||||||
|
method: get
|
||||||
|
mailConfig:
|
||||||
|
handler: api/mail-config.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/mail-config
|
||||||
|
method: get
|
||||||
|
ports:
|
||||||
|
handler: api/ports.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/ports
|
||||||
|
method: get
|
||||||
|
quality:
|
||||||
|
handler: api/quality.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/quality
|
||||||
|
method: get
|
||||||
|
rank:
|
||||||
|
handler: api/rank.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/rank
|
||||||
|
method: get
|
||||||
redirects:
|
redirects:
|
||||||
handler: api/redirects.handler
|
handler: api/redirects.handler
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: api/redirects
|
path: api/redirects
|
||||||
method: get
|
method: get
|
||||||
|
robotsTxt:
|
||||||
|
handler: api/robots-txt.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/robots-txt
|
||||||
|
method: get
|
||||||
|
screenshot:
|
||||||
|
handler: api/screenshot.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/screenshot
|
||||||
|
method: get
|
||||||
|
securityTxt:
|
||||||
|
handler: api/security-txt.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/security-txt
|
||||||
|
method: get
|
||||||
|
sitemap:
|
||||||
|
handler: api/sitemap.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/sitemap
|
||||||
|
method: get
|
||||||
socialTags:
|
socialTags:
|
||||||
handler: api/social-tags.handler
|
handler: api/social-tags.handler
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: api/social-tags
|
path: api/social-tags
|
||||||
method: get
|
method: get
|
||||||
|
ssl:
|
||||||
|
handler: api/ssl.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/ssl
|
||||||
|
method: get
|
||||||
|
status:
|
||||||
|
handler: api/status.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/status
|
||||||
|
method: get
|
||||||
|
techStack:
|
||||||
|
handler: api/tech-stack.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/tech-stack
|
||||||
|
method: get
|
||||||
|
threats:
|
||||||
|
handler: api/threats.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/threats
|
||||||
|
method: get
|
||||||
|
tls:
|
||||||
|
handler: api/tls.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/tls
|
||||||
|
method: get
|
||||||
|
traceRoute:
|
||||||
|
handler: api/trace-route.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/trace-route
|
||||||
|
method: get
|
||||||
txtRecords:
|
txtRecords:
|
||||||
handler: api/txt-records.handler
|
handler: api/txt-records.handler
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: api/txt-records
|
path: api/txt-records
|
||||||
method: get
|
method: get
|
||||||
|
whois:
|
||||||
|
handler: api/whois.handler
|
||||||
|
events:
|
||||||
|
- http:
|
||||||
|
path: api/whois
|
||||||
|
method: get
|
||||||
|
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
# - serverless-webpack
|
- serverless-webpack
|
||||||
- serverless-domain-manager
|
# - serverless-domain-manager
|
||||||
- serverless-offline
|
# - serverless-offline
|
||||||
|
|
||||||
custom:
|
custom:
|
||||||
webpack:
|
webpack:
|
||||||
webpackConfig: 'api/_common/aws-webpack.config.js'
|
webpackConfig: 'api/_common/aws-webpack.config.js'
|
||||||
includeModules: true
|
includeModules: false
|
||||||
|
packagerOptions:
|
||||||
|
noInstall: true
|
||||||
|
|
||||||
customDomain:
|
# customDomain:
|
||||||
domainName: example.com
|
# domainName: example.com
|
||||||
basePath: 'api'
|
# basePath: 'api'
|
||||||
stage: ${self:provider.stage}
|
# stage: ${self:provider.stage}
|
||||||
createRoute53Record: true
|
# createRoute53Record: true
|
||||||
|
|
||||||
serverless-offline:
|
# serverless-offline:
|
||||||
prefix: ''
|
# prefix: ''
|
||||||
httpPort: 3000
|
# httpPort: 3000
|
||||||
|
Loading…
Reference in New Issue
Block a user