upadte chart #11
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
name: Build and deploy Python app to Azure Web App - seaf | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python version | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install system dependencies | |
run: sudo apt-get install -y libgeos-dev | |
- name: Create and start virtual environment | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
pip install --upgrade pip | |
- name: Install dependencies | |
run: | | |
source venv/bin/activate | |
pip install -r requirements.txt | |
- name: Zip artifact for deployment | |
run: | | |
zip -r release.zip . | |
- name: Upload artifact for deployment jobs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-app | |
path: release.zip | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-app | |
- name: Unzip artifact for deployment | |
run: unzip release.zip | |
- name: 'Deploy to Azure Web App' | |
uses: azure/webapps-deploy@v2 | |
id: deploy-to-webapp | |
with: | |
app-name: 'seaf' | |
slot-name: 'Production' | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_85B346D7A59A45529B419EFF4698320B }} | |
environment: | |
name: 'production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
permissions: | |
id-token: write | |
contents: read |