Skip to content

Commit 80489cb

Browse files
committed
ci: 添加 Docker 镜像自动构建和推送
- 在 GitHub Actions 中添加每日定时构建和推送 Docker 镜像 - 更新 Readme 文件中的 Star History 图表显示方式 - 添加子模块递归检出,确保所有子模块也被检出
1 parent 7b52603 commit 80489cb

File tree

4 files changed

+41
-19
lines changed

4 files changed

+41
-19
lines changed

.github/workflows/docker-image.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@ name: Docker Build and Push
33
on:
44
push:
55
branches: [ "master" ]
6-
workflow_dispatch: # 允许手动触发
6+
workflow_dispatch: # 手动触发
7+
schedule:
8+
- cron: '0 0 * * *' # 每天 UTC 时间 00:00 (北京时间 08:00) 运行
79

810
jobs:
911
build-and-push:
1012
runs-on: ubuntu-latest
11-
13+
1214
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
15-
16-
- name: Login to Docker Hub
17-
uses: docker/login-action@v2
18-
with:
19-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
20-
password: ${{ secrets.DOCKER_HUB_TOKEN }}
21-
22-
- name: Build and push
23-
run: |
24-
docker build -t uniapi:latest .
25-
docker tag uniapi:latest ryoshi541/uniapi:latest
26-
docker push ryoshi541/uniapi:latest
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: 'recursive' # 确保子模块也被检出
19+
20+
- name: Login to Docker Hub
21+
uses: docker/login-action@v2
22+
with:
23+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
24+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
25+
26+
- name: Build and push
27+
run: |
28+
docker build -t uniapi:latest .
29+
docker tag uniapi:latest ryoshi541/uniapi:latest
30+
docker push ryoshi541/uniapi:latest

ReadME.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616

1717
## Star History
1818

19-
[![Star History Chart](https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date)](https://www.star-history.com/#NGLSG/UniAPI&Date)
19+
<a href="https://www.star-history.com/#NGLSG/UniAPI&Date">
20+
<picture>
21+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date&theme=dark" />
22+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date" />
23+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date" />
24+
</picture>
25+
</a>
2026

2127
<a id="how-to-support-this-project"></a>
2228

ReadME_EN.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
---
1515
## Star History
1616

17-
[![Star History Chart](https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date)](https://www.star-history.com/#NGLSG/UniAPI&Date)
17+
<a href="https://www.star-history.com/#NGLSG/UniAPI&Date">
18+
<picture>
19+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date&theme=dark" />
20+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date" />
21+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date" />
22+
</picture>
23+
</a>
1824

1925
<a id="how-to-support-this-project"></a>
2026
## 🌟 How to Support This Project

ReadME_JP.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
---
1515
## Star History
1616

17-
[![Star History Chart](https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date)](https://www.star-history.com/#NGLSG/UniAPI&Date)
17+
<a href="https://www.star-history.com/#NGLSG/UniAPI&Date">
18+
<picture>
19+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date&theme=dark" />
20+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date" />
21+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=NGLSG/UniAPI&type=Date" />
22+
</picture>
23+
</a>
1824

1925
<a id="how-to-support-this-project"></a>
2026
## 🌟 このプロジェクトをサポートする方法

0 commit comments

Comments
 (0)