Skip to content

Commit

Permalink
Add template
Browse files Browse the repository at this point in the history
  • Loading branch information
ltan02 committed Oct 21, 2023
1 parent 00d7c9a commit 09a54cf
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 30 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/backend/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build Python and Django

on:
workflow_call:
inputs:
python_version:
description: 'Python version'
type: string
default: '3.10'
secrets:
django_secret:
required: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ inputs.python_verison }}
uses: actions/setup-python@v3
with:
python-version: ${{ inputs.python_version }}

- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}

- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev
- name: Makes sure it runs
env:
SECRET_KEY: ${{ secrets.django_secret }}
run: |
pipenv run python manage.py check
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build Pipeline

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
python:
uses: backend/python.yml
secrets:
django_secret: ${{ secrets.DJANGO_SECRET }}

30 changes: 0 additions & 30 deletions .github/workflows/django.yml

This file was deleted.

0 comments on commit 09a54cf

Please sign in to comment.