Skip to content

Merge branch 'feature-dynamic_resizing' into development #82

Merge branch 'feature-dynamic_resizing' into development

Merge branch 'feature-dynamic_resizing' into development #82

name: Run Python Tests and Deploy to Heroku Environment
on:
push:
branches: [ main, development, ci ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
- run: git submodule update --init --recursive
- name: Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install Dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Run Python Tests
run: python runtests.py
environment:
runs-on: ubuntu-latest
outputs:
ENV: ${{ env.ENVIRONMENT }}
steps:
- name: Set env to test
if: endsWith(github.ref, '/ci')
run: |
echo "ENVIRONMENT=ljsimpleregisterlookup-test" >> $GITHUB_ENV
- name: Set env to staging
if: endsWith(github.ref, '/development')
run: |
echo "ENVIRONMENT=ljsimpleregisterlookup-staging" >> $GITHUB_ENV
- name: Set env to production
if: endsWith(github.ref, '/main')
run: |
echo "ENVIRONMENT=ljsimpleregisterlookup" >> $GITHUB_ENV
deploy:
needs: [test, environment] # Wait until test, environment jobs completes before deploying
environment: ${{ needs.environment.outputs.ENV }}
runs-on: ubuntu-latest
steps:
- name: Install Heroku CLI
run: curl https://cli-assets.heroku.com/install.sh | sh
- uses: actions/checkout@v4
#- run: git submodule update --init --recursive
- uses: AkhileshNS/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ vars.APP_NAME }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}
healthcheck: ${{ vars.APP_HEALTHCHECK_LINK }}
delay: 3
dontuseforce: true
# rollbackonhealthcheckfailed: true # Do we need to rollback?