Skip to content

Commit

Permalink
Add deployment validation for linux to GitHub action since we are dep…
Browse files Browse the repository at this point in the history
…loying 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...
  • Loading branch information
jonburchel committed Jul 28, 2024
1 parent 485a0f9 commit 99f6bf6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/uufsolver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,28 @@ jobs:
release.zip
!venv/
validate-deploy:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Unpack and validate virtual environment
run: |
tar -xzf venv.tar.gz
source venv/bin/activate
export PATH=$PATH:/home/.local/bin:/home/site/wwwroot/venv/bin
pip install --upgrade pip
pip install -r requirements.txt
python app.py &
sleep 10 # Give the app some time to start
curl -f http://localhost:8000 # Adjust the URL to match your app's expected response
pkill -f python # Kill the app after validation
deploy:
runs-on: ubuntu-latest
needs: build
needs: validate-deploy
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
Expand Down
1 change: 0 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ then
apt-get install -y python3-venv
fi


# Ensure pip is available
if ! command -v pip &> /dev/null
then
Expand Down

0 comments on commit 99f6bf6

Please sign in to comment.