universal keyboard shortcut message check #7
This file contains hidden or 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: Deploy to Azure Web App | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - backend/migration | |
| workflow_dispatch: | |
| env: | |
| AZURE_WEBAPP_NAME: 'pythonide-app' # Replace with your app name from azure-config.json | |
| PYTHON_VERSION: '3.11' | |
| NODE_VERSION: '18.x' | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r server/requirements.txt | |
| - name: Install Node dependencies and build frontend | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Create deployment package | |
| run: | | |
| # Create a clean deployment directory | |
| mkdir -p deploy | |
| cp -r server deploy/ | |
| cp -r dist deploy/ | |
| cp requirements.txt deploy/ | |
| cp startup.txt deploy/ | |
| # Create startup script for Azure | |
| echo '#!/bin/bash' > deploy/startup.sh | |
| echo 'cd server && python server.py' >> deploy/startup.sh | |
| chmod +x deploy/startup.sh | |
| - name: Login to Azure | |
| uses: azure/login@v1 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| - name: Deploy to Azure Web App | |
| uses: azure/webapps-deploy@v2 | |
| with: | |
| app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
| package: deploy | |
| - name: Restart Azure Web App | |
| run: | | |
| az webapp restart --name ${{ env.AZURE_WEBAPP_NAME }} --resource-group PythonIDE-Student-RG |