TIFU #137
Workflow file for this run
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: Django CI | |
on: [push, pull_request] | |
env: | |
DJANGO_SECRET_KEY: pnunez1 | |
NEWUSER_PW: pnunez2 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.9] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Run Tests | |
run: | | |
python manage.py test | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
if: success() && github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
scripts/deploy.sh | |
sparse-checkout-cone-mode: false | |
- name: Read deploy script contents | |
uses: andstor/[email protected] | |
id: deploy_script | |
with: | |
path: scripts/deploy.sh | |
- name: Run deployment script if master branch updated | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.DEPLOY_KEY }} | |
port: ${{ secrets.DEPLOY_PORT }} | |
script: ${{ steps.deploy_script.outputs.contents }} | |