Skip to content

Commit 99f6bf6

Browse files
committed
Add deployment validation for linux to GitHub action since we are deploying to a linux machine in Azure. This will ensure deployments will succeed before we actually do deploy from the GitHub build to Azure, and save us time with failed deployments...
1 parent 485a0f9 commit 99f6bf6

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/uufsolver.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,28 @@ jobs:
4242
release.zip
4343
!venv/
4444
45+
validate-deploy:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
52+
- name: Unpack and validate virtual environment
53+
run: |
54+
tar -xzf venv.tar.gz
55+
source venv/bin/activate
56+
export PATH=$PATH:/home/.local/bin:/home/site/wwwroot/venv/bin
57+
pip install --upgrade pip
58+
pip install -r requirements.txt
59+
python app.py &
60+
sleep 10 # Give the app some time to start
61+
curl -f http://localhost:8000 # Adjust the URL to match your app's expected response
62+
pkill -f python # Kill the app after validation
63+
4564
deploy:
4665
runs-on: ubuntu-latest
47-
needs: build
66+
needs: validate-deploy
4867
environment:
4968
name: 'Production'
5069
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

deploy.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ then
2323
apt-get install -y python3-venv
2424
fi
2525

26-
2726
# Ensure pip is available
2827
if ! command -v pip &> /dev/null
2928
then

0 commit comments

Comments
 (0)