mirror of https://github.com/snachodog/mybuddy.git
81 lines
2.4 KiB
YAML
81 lines
2.4 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v3
|
|
id: setup-python
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: ~/.local/share/virtualenvs
|
|
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('**/requirements.txt') }}
|
|
- name: Install Python dependencies
|
|
run: |
|
|
python -m pip install --upgrade pipenv wheel
|
|
pipenv install --dev
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
- run: |
|
|
npm install -g gulp-cli
|
|
npm install
|
|
gulp lint
|
|
gulp coverage
|
|
- 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
|
|
coveralls_finish:
|
|
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
|
|
deploy-docs:
|
|
needs: test
|
|
name: Deploy docs
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: documentation
|
|
url: https://docs.baby-buddy.net
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
steps:
|
|
- name: Checkout main
|
|
uses: actions/checkout@v3
|
|
- name: Deploy docs
|
|
uses: mhausenblas/mkdocs-deploy-gh-pages@master
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.github_token }}
|
|
REQUIREMENTS: docs/requirements.txt
|
|
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 }} |