Skip to content

Commit

Permalink
4 -tentativa de build
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlosesposito22 authored Nov 9, 2024
1 parent 5f4105e commit 92dd473
Showing 1 changed file with 41 additions and 15 deletions.
56 changes: 41 additions & 15 deletions .github/workflows/main_bookheaded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Build and deploy Python app to Azure Web App - Bookheaded
on:
push:
branches:
- main
- prod
workflow_dispatch:

jobs:
Expand All @@ -28,12 +28,39 @@ jobs:
source venv/bin/activate
- name: Install dependencies
run: pip install -r requirements.txt

# Optional: Add step to run tests here (PyTest, Django test suites, etc.)
run: |
set -ex
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set up ChromeDriver
uses: nanasess/setup-chromedriver@v2
with:
version: latest

- name: Run local server and tests
run: |
python manage.py makemigrations
python manage.py migrate
python manage.py runserver &
sleep 5
python manage.py test
- name: Cleaning testing files
run: |
cd BookHeaded/
rm db.sqlite3
rm .env
cd ..
- name: Zip artifact for deployment
run: zip release.zip ./* -r
run: |
cd BookHeaded/
zip release.zip ./* -r
cd ..
mv BookHeaded/release.zip .
- name: Upload artifact for deployment jobs
uses: actions/upload-artifact@v4
Expand All @@ -49,8 +76,8 @@ jobs:
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT
permissions:
id-token: write #This is required for requesting the JWT

steps:
- name: Download artifact from build job
Expand All @@ -61,18 +88,17 @@ jobs:
- name: Unzip artifact for deployment
run: unzip release.zip


- name: Login to Azure
uses: azure/#@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_24FDB014694944F1A7BAF297AF81D7EC }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_FBC196204F404EB8BD6B04366DEAD258 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_EE8C237179CE4A6FB0BCEF9E4A798235 }}

- name: Login to Azure
uses: azure/#@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_789698FB3D5F4BFF94B9BBB9E4ECB7D6 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_8DB24EEC8D1D4337B3672A15A4AD0679 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_FFB99FA9EFEC482DAB6C56CE15119C1A }}

- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v3
id: deploy-to-webapp
with:
app-name: 'Bookheaded'
slot-name: 'Production'

0 comments on commit 92dd473

Please # to comment.