2022-05-22 22:41:06 +00:00
|
|
|
name: Demo reset
|
|
|
|
on:
|
2022-06-02 19:04:35 +00:00
|
|
|
schedule:
|
|
|
|
- cron: "0 */3 * * *"
|
2022-05-23 23:25:25 +00:00
|
|
|
workflow_dispatch:
|
2022-05-22 22:41:06 +00:00
|
|
|
jobs:
|
|
|
|
reset:
|
|
|
|
name: Reset
|
|
|
|
runs-on: ubuntu-latest
|
2022-06-03 03:48:37 +00:00
|
|
|
environment:
|
|
|
|
name: demo
|
|
|
|
url: https://demo.baby-buddy.net
|
2022-05-22 22:41:06 +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
|
2022-05-22 22:41:06 +00:00
|
|
|
with:
|
2022-06-03 03:11:49 +00:00
|
|
|
python-version: '3.x'
|
2022-06-02 18:29:54 +00:00
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
2022-06-03 03:53:32 +00:00
|
|
|
path: |
|
|
|
|
~/.local/share/virtualenvs
|
|
|
|
Pipfile.lock
|
2022-06-02 18:29:54 +00:00
|
|
|
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('**/requirements.txt') }}
|
|
|
|
- name: Install pipenv
|
|
|
|
run: python -m pip install --upgrade pipenv wheel
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pipenv install
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
2022-06-03 03:11:49 +00:00
|
|
|
node-version: '16'
|
2022-06-02 17:29:48 +00:00
|
|
|
- name: Install Railway CLI
|
|
|
|
run: npm i -g @railway/cli
|
|
|
|
- name: Reset demo database
|
2022-06-02 18:41:30 +00:00
|
|
|
run: npx railway run pipenv run python manage.py reset --no-input
|
2022-06-02 17:29:48 +00:00
|
|
|
env:
|
2022-06-02 18:29:54 +00:00
|
|
|
DJANGO_SETTINGS_MODULE: babybuddy.settings.railway
|
2022-06-02 17:56:28 +00:00
|
|
|
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
|