Skip to content

Merge pull request #242 from djangonaut-space/develop #57

Merge pull request #242 from djangonaut-space/develop

Merge pull request #242 from djangonaut-space/develop #57

# 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
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idenv
name: Build and deploy Python app to Azure Web App - djangonaut-space
on:
push:
branches:
- main
workflow_dispatch:
env:
AZURE_WEBAPP_NAME: djangonaut-space
AZURE_WEBAPP_PACKAGE_PATH: '.'
jobs:
build:
env:
ENVIRONMENT: 'production'
DJANGO_SETTINGS_MODULE: 'indymeet.settings.production'
APPINSIGHTS_INSTRUMENTATIONKEY: ${{ secrets.APPINSIGHTS_INSTRUMENTATIONKEY }}
APPLICATIONINSIGHTSAGENT_EXTENSION_ENABLED: 'true'
DEBUG: False
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
RECAPTCHA_PRIVATE_KEY: ${{ secrets.RECAPTCHA_PRIVATE_KEY }}
RECAPTCHA_PUBLIC_KEY: ${{ secrets.RECAPTCHA_PUBLIC_KEY }}
SCM_DO_BUILD_DURING_DEPLOYMENT: 'true'
SECRET_KEY: ${{ secrets.SECRET_KEY }}
USER: ${{ secrets.USER }}
WEBSITE_HTTPLOGGING_RETENTION_DAYS: '7'
AZURE_ACCOUNT_NAME: ${{ secrets.AZURE_ACCOUNT_NAME }}
AZURE_ACCOUNT_KEY: ${{ secrets.AZURE_ACCOUNT_KEY }}
# collectstatic is run in the POST_BUILD_COMMAND now
DISABLE_COLLECTSTATIC: 'true'
# Use a custom post build command to compile the tailwind css and collectstatic
POST_BUILD_COMMAND: 'scripts/postbuild.sh'
# Allow install node to support tailwind
ENABLE_MULTIPLATFORM_BUILD: 'true'
environment: prod-djangonaut-space
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python version
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
echo ENV
printenv -0
- name: Building web app
uses: azure/appservice-build@v2
- name: Deploy web App using GH Action azure/webapps-deploy
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}