Skip to content

splitting deploy-dev.yml on 2 scripts: frontend and backend #110

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 1 commit into
base: definesfineout-patch-1
Choose a base branch
from
Open
Show file tree
Hide file tree
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
45 changes: 45 additions & 0 deletions .github/workflows/deploy-dev-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow runs backend tests, then executes the serverless deploy dev stage

name: Deploy Dev Backend

on:
push:
branches: [ main ]

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

deploy:
name: Deploy Dev Backend
runs-on: ubuntu-latest
needs: [backend]
steps:
- uses: actions/checkout@main
- name: npm install
uses: actions/npm@main
with:
args: install
- name: serverless deploy
uses: serverless/github-action@main
with:
args: deploy --stage dev
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
43 changes: 43 additions & 0 deletions .github/workflows/deploy-dev-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow runs frontend tests, then executes the serverless deploy dev stage

name: Deploy Dev Frontend

on:
push:
branches: [ main ]

jobs:
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 Frontend
runs-on: ubuntu-latest
needs: [frontend]
steps:
- uses: actions/checkout@main
- name: npm install
uses: actions/npm@main
with:
args: install
- name: serverless deploy
uses: serverless/github-action@main
with:
args: deploy --stage dev
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}