Merge pull request '調整:第三方 action 與工具的版本也從 Gitea 變數取得' (#2) from chore/third-party-versions into main
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
name: ci
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
|`restore_keys`|||找不到完全相同的 key 時,依序嘗試的前綴(每行一個),例如 ci-home-|
|
||||
|`path`||`.ci-home`|要快取的路徑|
|
||||
|
||||
## 內部引用的版本
|
||||
|
||||
`actions/cache` 的版本取自呼叫端 repo 的 Gitea 變數 `ACTION_CACHE_VERSION`(例如 `v4`),不寫死在 `action.yml`,所以呼叫端要先設好。
|
||||
|
||||
## 開發與發版
|
||||
|
||||
- CI(`ci.yaml`):用 [action-ci](https://gitea.jsc.idv.tw/actions/action-ci),並用 `uses: ./` 實際執行一次。
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
name: ci-cache
|
||||
description: "還原與儲存 CI 的快取目錄(預設 workspace 的 .ci-home:Go 模組與建置快取、npm、工具鏈、rod 下載的 Chromium)。包一層 actions/cache,要在 checkout 之後使用;key 由呼叫端用 hashFiles 算好傳入"
|
||||
description: "還原與儲存 CI 的快取目錄(預設 workspace 的 .ci-home:Go 模組與建置快取、npm、工具鏈、rod 下載的 Chromium)。包一層 actions/cache(版本取自呼叫端的 Gitea 變數 ACTION_CACHE_VERSION),要在 checkout 之後使用;key 由呼叫端用 hashFiles 算好傳入"
|
||||
inputs:
|
||||
key:
|
||||
description: "快取 key,例如 ci-home-${{ hashFiles('go.sum', 'web/package-lock.json') }}"
|
||||
@@ -13,7 +13,7 @@ inputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@${{ vars.ACTION_CACHE_VERSION }}
|
||||
with:
|
||||
path: ${{ inputs.path }}
|
||||
key: ${{ inputs.key }}
|
||||
|
||||
Reference in New Issue
Block a user