Skip to content

backup

backup #6

Workflow file for this run

name: Backend CI/CD pipeline
on:
push:
branches:
- main
paths:
- 'src/backend/**'
pull_request:
branches:
- main
paths:
- 'src/backend/functions/**'
- 'src/backend/package.json'
defaults:
run:
working-directory: src/backend
env:
# ----- AWS -----
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
jobs:
test:
name: Run Integration and Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache-dependency-path: src/frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
lint:
name: Run lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache-dependency-path: src/frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
deploy:
name: Deploy function
runs-on: ubuntu-latest
needs: [test, lint]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment: production
steps:
- uses: actions/checkout@v4
- name: Terraform Apply
uses: dflook/terraform-apply@v2
with:
path: infra
workspace: prod
var_file: infra/envs/prod.tfvars
auto_approve: true
target: module.backend