Skip to content

RyanHUNGry activated ci/cd pipeline #9

RyanHUNGry activated ci/cd pipeline

RyanHUNGry activated ci/cd pipeline #9

Workflow file for this run

name: lint, test, build, and deploy containerized dataflow API to ec2
run-name: ${{ github.actor }} activated ci/cd pipeline
on:
push:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend # Only applies to run steps
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Install dependencies
run: npm i eslint
- name: Run linting script with eslint
run: npx eslint .
# After linting, containerize application on a test environment and run tests
test:
needs: lint
environment: test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend # Only applies to run steps
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Create image
run: docker build -t docker.io/fishy3legs/dataflow-api:1.0 .
- name: Start container with proper test environment variables
run: docker run -d --name test-container -e NODE_ENV=test -e AWS_PUBLIC_KEY=${{ secrets.AWS_PUBLIC_KEY }} -e AWS_SECRET_KEY=${{ secrets.AWS_SECRET_KEY }} -e AWS_RDS_TEST=${{ secrets.AWS_RDS_TEST }} -e JWT_SECRET=${{ secrets.JWT_SECRET }} docker.io/fishy3legs/dataflow-api:1.0
- name: Run tests with application inside test container
run: docker exec test-container npm run integration-tests