2021-05-20 04:12:03 +00:00
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-05-31 15:25:35 +00:00
|
|
|
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
|
2021-05-20 04:12:03 +00:00
|
|
|
steps:
|
2022-06-03 03:11:49 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v3
|
2022-06-03 03:19:24 +00:00
|
|
|
id: setup-python
|
2021-05-20 04:12:03 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2022-06-03 03:11:49 +00:00
|
|
|
- uses: actions/cache@v3
|
2021-05-20 04:12:03 +00:00
|
|
|
with:
|
2022-06-03 03:53:32 +00:00
|
|
|
path: |
|
|
|
|
~/.local/share/virtualenvs
|
|
|
|
Pipfile.lock
|
2022-06-03 03:11:49 +00:00
|
|
|
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('**/requirements.txt') }}
|
|
|
|
- name: Install Python dependencies
|
2022-06-03 03:14:18 +00:00
|
|
|
run: |
|
2021-05-20 04:12:03 +00:00
|
|
|
python -m pip install --upgrade pipenv wheel
|
2021-11-07 21:02:28 +00:00
|
|
|
pipenv install --dev
|
2022-06-03 03:11:49 +00:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
- run: |
|
|
|
|
npm install -g gulp-cli
|
|
|
|
npm install
|
|
|
|
gulp lint
|
|
|
|
gulp coverage
|
2021-05-20 04:12:03 +00:00
|
|
|
- name: Submit results to Coveralls
|
|
|
|
uses: AndreMiras/coveralls-python-action@develop
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
flag-name: test-python-${{ matrix.python-version }}
|
|
|
|
parallel: true
|
2022-06-03 03:54:48 +00:00
|
|
|
coveralls-finish:
|
2021-05-20 04:12:03 +00:00
|
|
|
needs: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Coveralls Finished
|
|
|
|
uses: AndreMiras/coveralls-python-action@develop
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
parallel-finished: true
|
2022-05-28 20:13:38 +00:00
|
|
|
deploy-docs:
|
2022-05-28 20:30:27 +00:00
|
|
|
needs: test
|
2022-05-28 20:13:38 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-03 03:44:47 +00:00
|
|
|
environment:
|
|
|
|
name: documentation
|
|
|
|
url: https://docs.baby-buddy.net
|
2022-05-28 20:13:38 +00:00
|
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
|
|
steps:
|
2022-06-03 03:54:48 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-05-28 20:13:38 +00:00
|
|
|
- name: Deploy docs
|
|
|
|
uses: mhausenblas/mkdocs-deploy-gh-pages@master
|
|
|
|
env:
|
2022-06-03 03:11:49 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.github_token }}
|
2022-05-28 20:27:36 +00:00
|
|
|
REQUIREMENTS: docs/requirements.txt
|
2022-06-03 03:48:37 +00:00
|
|
|
deploy-demo:
|
|
|
|
needs: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
environment:
|
|
|
|
name: demo
|
|
|
|
url: https://demo.baby-buddy.net
|
|
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Deploy demo
|
|
|
|
run: npx railway up
|
|
|
|
env:
|
|
|
|
DJANGO_SETTINGS_MODULE: babybuddy.settings.railway
|
|
|
|
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
|