Skip to content

Merge branch 'main' into develop #62

Merge branch 'main' into develop

Merge branch 'main' into develop #62

name: Deploy to Staging
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python version
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: pip install -r requirements.txt
- name: Test with pytest
run: |
pip install pytest
pip install pytest-cov
pytest tests/
- name: Upload artifact for deployment jobs
uses: actions/upload-artifact@v2
with:
name: python-app
path: |
.
!venv/
deploy:
runs-on: ubuntu-latest
needs: build
concurrency: staging
environment:
name: "staging"
url: ${{ vars.AZURE_WEBAPP_URL }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
name: python-app
path: .
- name: "Deploy to Azure Web App"
uses: azure/webapps-deploy@v2
id: deploy-to-webapp
with:
app-name: ${{ vars.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.STAGING_AZURE_PUBLISH_PROFILE }}