Feature/safe gpt ocr #158
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: Backend Production Branch CI/CD | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "backend/**" | |
jobs: | |
backend-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- name: Install backend dependencies | |
working-directory: ./backend | |
run: npm install --include=dev | |
- name: Run full backend test suite | |
working-directory: ./backend | |
run: | | |
npm run test:unit | |
npm run test:integration | |
deploy-backend: | |
runs-on: ubuntu-latest | |
needs: backend-tests | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- name: Install backend dependencies | |
working-directory: ./backend | |
run: npm install --include=dev | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Set up SAM CLI | |
uses: aws-actions/setup-sam@v2 | |
with: | |
use-installer: true | |
- name: Make deploy script executable | |
run: chmod +x ./scripts/deploy-backend.sh | |
- name: Deploy backend to staging | |
run: ./scripts/deploy-backend.sh production | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
BOTPRESS_TOKEN: ${{ secrets.BOTPRESS_TOKEN }} | |
BOTPRESS_ENDPOINT: ${{ secrets.BOTPRESS_ENDPOINT }} |