ci: add functions-dir operational test (#206)

This commit is contained in:
Ryo Ota
2020-06-28 11:20:50 +09:00
committed by GitHub
parent 44606b229b
commit 8812f4f220
2 changed files with 12 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ jobs:
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
functions-dir: './functions-test'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

11
functions-test/hello.js Normal file
View File

@@ -0,0 +1,11 @@
// NOTE: This is for operational test
// Go to https://hogehoge--nwtgck-actions-netlify.netlify.app/.netlify/functions/hello?name=John
// (from: https://kentcdodds.com/blog/super-simple-start-to-serverless)
exports.handler = async event => {
const subject = event.queryStringParameters.name || 'World'
return {
statusCode: 200,
body: `Hello ${subject}!`,
}
}