Merge pull request #129 from ODNZSL/docs/local-setup-update #369
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
name: Deployment | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- production | |
jobs: | |
check-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check dependencies for security vulnerabilities | |
uses: g-rath/check-with-osv-detector@main | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- run: cp example.env .env | |
- name: Build the docker-compose stack | |
run: docker-compose up -d | |
- name: Check running containers | |
run: docker ps -a | |
- name: Check logs | |
run: docker-compose logs backend | |
- name: Run test suite | |
run: docker-compose run backend bin/runtests.py | |
- name: Deploy app to UAT | |
if: github.ref == 'refs/heads/master' | |
env: | |
HEROKU_API_KEY: ${{secrets.HEROKU_UAT_API_KEY}} | |
HEROKU_APP_NAME: ${{secrets.HEROKU_UAT_APP_NAME}} | |
run: | | |
echo $HEROKU_API_KEY | docker login --username=_ --password-stdin registry.heroku.com | |
docker tag $(docker-compose images -q backend) registry.heroku.com/$HEROKU_APP_NAME/web | |
docker push registry.heroku.com/$HEROKU_APP_NAME/web | |
heroku container:release web -a $HEROKU_APP_NAME | |
- name: Deploy app to Production | |
if: github.ref == 'refs/heads/production' | |
env: | |
HEROKU_API_KEY: ${{secrets.HEROKU_PRODUCTION_API_KEY}} | |
HEROKU_APP_NAME: ${{secrets.HEROKU_PRODUCTION_APP_NAME}} | |
run: | | |
echo $HEROKU_API_KEY | docker login --username=_ --password-stdin registry.heroku.com | |
docker tag $(docker-compose images -q backend) registry.heroku.com/$HEROKU_APP_NAME/web | |
docker push registry.heroku.com/$HEROKU_APP_NAME/web | |
heroku container:release web -a $HEROKU_APP_NAME |