-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
使用 tinystatus 试试看
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: 测试 - 生成服务状态页面 | ||
|
||
on: | ||
schedule: | ||
- cron: '*/1 * * * *' # 每隔1分钟执行一次 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Python 3.12 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.12 | ||
|
||
# Step 3: Install dependencies from requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
# Step 4: Run tinystatus.py and stop it after 1 minute | ||
- name: Run tinystatus.py and stop after 1 minute | ||
run: | | ||
timeout 60s python tinystatus.py | ||
# Step 5: Commit and push the contents of ./output to the gh-pages branch | ||
- name: Deploy to gh-pages | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git checkout -B gh-pages | ||
cp -r ./output/* . | ||
git add . | ||
git commit -m "Deploy updated output" | ||
git push origin gh-pages --force |