Added to requirements #255
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
# This is a workflow to test and deploy our demo app. | |
name: Demo CI/CD | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
DEMO_HOME: /home/runner/work/backend/backend/ | |
PYTHONPATH: /home/runner/work/backend/backend/ | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
environment: pa_deploy | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
# Semantic version range syntax or exact version of a Python version | |
python-version: '3.9' | |
# Optional - x64 or x86 architecture, defaults to x64 | |
architecture: 'x64' | |
# You can test your matrix by printing the current Python version | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Install MongoDB in a Docker container. | |
uses: supercharge/mongodb-github-action@1.8.0 | |
- name: Install Python packages. | |
run: make dev_env | |
- name: Check Flask version | |
run: pip show flask | |
- name: Check Flask-restx version | |
run: pip show flask-restx | |
- name: Run Python tests. | |
run: make tests | |
- name: Deploy to PythonAnywhere | |
run: ./deploy.sh | |
env: | |
PA_PWD: ${{secrets.PA_PWD}} |