Files
ci-run/README.md
T
2026-11-05 02:54:24 +00:00

30 lines
958 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ci-run
組合 `ci-cache` 與 `ci-env`:先還原快取,再在容器裡執行指令。
## 用法
版本由呼叫端的 Gitea Actions 變數決定(例如 `vars.ACTION_CI_RUN_VERSION`),不要用分支名稱:runner 依 ref 重用舊映像檔,改了腳本不會生效,所以每次改動都發新標籤。
```yaml
- uses: https://gitea.jsc.idv.tw/actions/ci-run@${{ vars.ACTION_CI_RUN_VERSION }}
with:
command: ...
cache_key: ...
```
## 輸入
|名稱|必填|預設|說明|
|---|---|---|---|
|`command`|是||要在 ci-env 容器裡執行的 shell 指令|
|`cache_key`|是||快取 key,例如 ci-home-${{ hashFiles('go.sum', 'web/package-lock.json') }}|
|`cache_restore_keys`|||找不到完全相同的 key 時,依序嘗試的前綴(每行一個)|
|`name`||`ci`|執行指令的步驟名稱|
## 開發
`ci.yaml` 跑 ,並用 `uses: ./` 實際執行一次。
圖示:`icon.svg`(Gitea 儲存庫頭像用 `icon.png`)。