e
This commit is contained in:
parent
7dfabbea35
commit
00000d935f
1 changed files with 8 additions and 1 deletions
9
.github/workflows/m3u8.yml
vendored
9
.github/workflows/m3u8.yml
vendored
|
|
@ -10,17 +10,20 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check time
|
- name: Check time
|
||||||
|
id: check_time
|
||||||
run: |
|
run: |
|
||||||
hour=$(TZ=America/New_York date +%-H)
|
hour=$(TZ=America/New_York date +%-H)
|
||||||
|
|
||||||
(( hour >= 8 && hour <= 23 )) || exit 78
|
(( hour >= 8 && hour <= 23 )) && echo "run=true" >> $GITHUB_OUTPUT || echo "run=false" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
if: steps.check_time.outputs.run == 'true'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Cache venv
|
- name: Cache venv
|
||||||
|
if: steps.check_time.outputs.run == 'true'
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: .venv
|
path: .venv
|
||||||
|
|
@ -29,6 +32,7 @@ jobs:
|
||||||
shared-venv-${{ runner.os }}-
|
shared-venv-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
|
if: steps.check_time.outputs.run == 'true'
|
||||||
uses: astral-sh/setup-uv@v6
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
version: "latest"
|
version: "latest"
|
||||||
|
|
@ -37,14 +41,17 @@ jobs:
|
||||||
cache-dependency-glob: "uv.lock"
|
cache-dependency-glob: "uv.lock"
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
|
if: steps.check_time.outputs.run == 'true'
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version-file: "pyproject.toml"
|
python-version-file: "pyproject.toml"
|
||||||
|
|
||||||
- name: Fetch M3U8
|
- name: Fetch M3U8
|
||||||
|
if: steps.check_time.outputs.run == 'true'
|
||||||
run: uv run M3U8/fetch.py
|
run: uv run M3U8/fetch.py
|
||||||
|
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
|
if: steps.check_time.outputs.run == 'true'
|
||||||
uses: stefanzweifel/git-auto-commit-action@v6
|
uses: stefanzweifel/git-auto-commit-action@v6
|
||||||
with:
|
with:
|
||||||
commit_message: "update M3U8"
|
commit_message: "update M3U8"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue