Merge branch 'main' of https://github.com/Carlosesposito22/BookHeaded #5
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
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-app | |
- name: Unzip artifact for deployment | |
run: unzip release.zip | |
# Atualizado para instalar as dependências dentro do diretório do projeto Django | |
- name: Install dependencies | |
run: pip install -r bookheaded/requirements.txt | |
# Limpar arquivos que podem gerar conflito no deploy da Azure | |
- name: Cleaning testing files | |
run: | | |
cd bookheaded/ | |
rm db.sqlite3 | |
rm .env | |
cd .. | |
# Compactação de artefatos para posterior upload | |
- name: Zip artifact for deployment | |
run: | | |
cd bookheaded/ | |
zip release.zip ./* -r | |
cd .. | |
mv bookheaded/release.zip . | |
- name: Login to Azure | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_D27119B9285846FC84413F360DD2C543 }} | |
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_D5F1D643BAA9453C9D627C23CF1DCABE }} | |
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_B6E58B30AC954CF4904E6681575CE644 }} | |
- name: 'Deploy to Azure Web App' | |
uses: azure/webapps-deploy@v3 | |
id: deploy-to-webapp | |
with: | |
app-name: 'bookheaded' | |
slot-name: 'Production' |