Integrate poetry into CI and disable deployment workflow #202
Workflow file for this run
This file contains hidden or 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: Cache poetry install | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local | |
key: poetry-1.1.12-0 | |
- name: Install poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Cache dependencies | |
id: cache-deps | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: pydeps-${{ hashFiles('**/poetry.lock') }} | |
- name: Install Dependencies | |
run: | | |
poetry install --no-interaction --no-root | |
if: steps.cache-deps.outputs.cache-hit != 'true' | |
- name: Run Tests | |
run: | | |
.venv/bin/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 }} |