endofyear/.github/workflows/build-and-run.yml
jiangmiemie d6def4acd0
Update build-and-run.yml
修正git action
2023-12-04 15:54:01 +08:00

47 lines
929 B
YAML

name: Build and Run
on:
push:
branches:
- main
jobs:
build-and-run:
runs-on: ubuntu-latest
# 不给权限会报错
permissions:
contents: write
steps:
- name: 1. Checkout repository
uses: actions/checkout@v4
- name: 2. Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: 3. Install
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: 4. Run
run: |
python ./main.py &
sleep 7
- name: 5. Build
run: |
wget http://localhost:7777
- name: 6. Log
run: |
cat endofyear.log
- name: 7. Push static HTML
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./static
publish_branch: html