48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Run Image Stitching Script
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # 当推送到 main 分支时触发
|
|
pull_request:
|
|
branches:
|
|
- main # 当对 main 分支创建 PR 时触发
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
run-script:
|
|
permissions:
|
|
contents: write # 允许对代码库的写入权限
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest # 使用最新的 Ubuntu 运行环境
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4 # 检出当前仓库代码
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.x' # 设置 Python 版本
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install opencv-python numpy # 安装必要的依赖包
|
|
|
|
- name: Run image stitching script
|
|
run: ./auto_pack_img.py
|
|
|
|
- name: Upload Pages artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: images
|
|
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|