Skip to content

Create deploy-dev.yml #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow runs both backend and frontend tests, then executes the serverless deploy dev stage

name: Deploy Dev

on:
push:
branches: [ master ]

jobs:
backend:
name: Build Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
cd backend
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: |
pip install pytest
pytest

frontend:
name: Build Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: |
cd frontend
npm ci
npm run build --if-present
npm test -- --coverage --watchAll=false
env:
CI: false

deploy:
name: Deploy Dev
runs-on: ubuntu-latest
needs: [backend, frontend]
steps:
- uses: actions/checkout@master
- name: npm install
uses: actions/npm@master
with:
args: install
- name: serverless deploy
uses: serverless/github-action@master
with:
args: deploy --stage dev
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}