Skip to content

update startup.

update startup. #170

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions
name: Build and deploy Python app to Azure Web App - chapman-experiments-3
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python version
uses: actions/setup-python@v4
with:
python-version: '3.9'
- 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: Run tests
env:
ALLOWED_HOSTS: localhost 127.0.0.1
CSRF_TRUSTED_ORIGINS : http://localhost:8000
DBHOST: localhost
DBNAME: github_actions
DBPASS: postgres
DBUSER: postgres
LOG_LOCATION: abc
ESI_AUTH_URL : abc
ESI_AUTH_ACCOUNT_URL : abc
ESI_AUTH_PASSWORD_RESET_URL : abc
ESI_AUTH_USERNAME : abc
ESI_AUTH_PASS : abc
ESI_AUTH_APP : abc
EMAIL_MS_HOST : abc
EMAIL_MS_USER_NAME : abc
EMAIL_MS_PASSWORD : abc
FITBIT_MS_USERNAME : abc
FITBIT_MS_PASS : abc
FITBIT_MS_URL : abc
FITBIT_MS_REGISTRATION : abc
FITBIT_TEST_ACCOUNT : abc
REDIS : abc
SECRET_KEY: super_duper_secret_key
run: python manage.py test
- name: Upload artifact for deployment jobs
uses: actions/upload-artifact@v3
with:
name: python-app
path: |
.
!venv/
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'dev'
#url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: python-app
path: .
- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v2
id: deploy-to-webapp
with:
app-name: 'chapman-experiments-3'
slot-name: 'dev'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_57F8373C8B574F52827A50E02C070D35 }}