This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
docs: add archive notice #143
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
name: Deploy | |
on: | |
push: | |
paths: | |
- src/** | |
- tests/** | |
- .github/workflows/main.yml | |
- package.json | |
- tsconfig.json | |
permissions: | |
id-token: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
LAMBDA_FUNCTION_NAME: ${{ vars.LAMBDA_FUNCTION_NAME }} | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2.2.0 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Install node dependencies | |
run: yarn --frozen-lockfile | |
- name: Run linter | |
run: yarn lint | |
- name: Run tests | |
run: yarn testci | |
- name: Build project | |
run: yarn build | |
- name: Zip build | |
run: (cd dist && zip -r ../deploy.zip .) | |
- name: Deploy to AWS | |
run: aws lambda update-function-code --function-name $LAMBDA_FUNCTION_NAME --zip-file=fileb://deploy.zip |