Skip to content

Commit 4a0835d

Browse files
colyerdengShawnDen-coder
authored andcommitted
fix: fix template github action
1 parent 555a97a commit 4a0835d

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/deploy_docs.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,34 @@ name: Deploy Docs
33

44
on:
55
release:
6-
types: [published] # 当 release 发布时触发,而不是创建时
6+
types: [published]
7+
branches: [main]
78
workflow_dispatch: # 保留手动触发选项
89

910
permissions:
1011
contents: write # 用于部署到 GitHub Pages
1112

1213
jobs:
13-
setup:
14-
uses: ./.github/workflows/setup.yaml
15-
with:
16-
install-deps: docs
17-
secrets: inherit
18-
1914
deploy:
20-
needs: setup
2115
runs-on: ubuntu-latest
2216
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "{{cookiecutter.max_python_version}}"
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v5
27+
28+
- name: Install dependencies
29+
run: uv sync --extra=docs
30+
2331
- name: Build and deploy documentation
24-
run: uvx mkdocs gh-deploy --force
32+
run: uv run mkdocs gh-deploy --force
2533
env:
26-
{% raw %}GITHUB_TOKEN: ${{ needs.setup.outputs.PERSONAL_ACCESS_TOKEN || github.token }}{% endraw %}
34+
GITHUB_TOKEN: ${{ github.token }}
35+
2736
{% endif %}

repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/release_build.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
name: release_build
1+
name: release-build
22

33
on:
4-
<<<<<<< HEAD
5-
push:
6-
tags:
7-
- '[0-9]*.[0-9]*.[0-9]*' # 匹配语义化版本号标签 (e.g., 1.0.0, 1.0.0-beta)
8-
=======
94
release:
10-
types: [published] # 当 release 发布时触发,而不是创建时
11-
>>>>>>> Ci/update-github-action
5+
types: [published]
6+
branches: [main]
127
workflow_dispatch:
138
inputs:
149
version:

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)