create reservation working changes #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Node.js project and deploy it to an Azure Functions App on Windows or Linux when a commit is pushed to your default branch. | |
# | |
name: Deploy Node.js to AWS lambda | |
on: | |
push: | |
branches: ["main"] | |
env: | |
AZURE_FUNCTIONAPP_NAME: 'kutir' # set this to your function app name on Azure | |
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your function app project, defaults to the repository root | |
NODE_VERSION: '16.x' # set this to the node version to use (e.g. '8.x', '10.x', '12.x') | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest # For Linux, use ubuntu-latest | |
environment: dev | |
steps: | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@v3 | |
- name: Setup Node ${{ env.NODE_VERSION }} Environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: 'Resolve Project Dependencies Using Npm' | |
shell: bash # For Linux, use bash | |
run: | | |
npm install | |
npm run build --if-present | |
npm run lint --if-present | |
npm run test --if-present | |
- name: Move node_modules to dist and Zip dist folder contents | |
run: (mv node_modules dist/node_modules && cd dist && zip -qq -r ../bundle.zip .) | |
- name: deploy zip to aws lambda | |
uses: appleboy/lambda-action@master | |
with: | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_region: ${{ secrets.AWS_REGION }} | |
function_name: kutir | |
zip_file: bundle.zip |