From bd449c189a62ffe3b4e03d083e895b42b720aca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=84=B8?= Date: Thu, 9 Jan 2025 21:36:58 +0900 Subject: [PATCH] Create python-app.yml --- .github/workflows/python-app.yml | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..f27fd06 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,51 @@ +name: Python application + +on: + schedule: + - cron: "0 13 * * 0-4" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v3 + with: + python-version: "3.12" + + # Cache Python dependencies + - name: Cache Python dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # Cache cookie.json + - name: Cache app/temp/cookie.json + uses: actions/cache@v3 + with: + path: app/temp/cookie.json + key: ${{ runner.os }}-cookie-${{ hashFiles('app/temp/cookie.json') }} + restore-keys: | + ${{ runner.os }}-cookie- + + - name: Install dependencies + run: | + pwd + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Generate Config + run: | + pwd + cd app && gen-config.sh + + - name: Run + run: | + pwd + cd app && ./run.sh