Skip to content

Commit

Permalink
Feat: 测试的 github action 脚本
Browse files Browse the repository at this point in the history
使用 tinystatus 试试看
  • Loading branch information
WendaoLee committed Oct 1, 2024
1 parent fee28e3 commit fa1c56b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
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

0 comments on commit fa1c56b

Please sign in to comment.