Skip to content

Feature/adding more features #44

Feature/adding more features

Feature/adding more features #44

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: OneTimeSharing Development Deployment
on:
workflow_dispatch:
pull_request:
branches: ["develop"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: ./infra/package-lock.json
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Add the environment name as env property
run: echo "ENVIRONMENT=dev"
- name: Install deps (Frontend)
working-directory: ./app
run: npm ci
- name: Install deps (Backend)
working-directory: ./handlers
run: npm ci
- name: Install deps (Infra)
working-directory: ./infra
run: npm ci
- name: Run tests
working-directory: ./handlers
run: npm run test
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1 # or your preferred AWS region
- name: Deploy the CDK (Prod)
working-directory: ./infra
run: npm run deploy