調整:第三方 action 與工具的版本也從 Gitea 變數取得 #2
@@ -1,7 +1,5 @@
|
|||||||
name: ci
|
name: ci
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ci-${{ github.ref }}
|
group: ci-${{ github.ref }}
|
||||||
|
|||||||
@@ -20,6 +20,10 @@
|
|||||||
|`restore_keys`|||找不到完全相同的 key 時,依序嘗試的前綴(每行一個),例如 ci-home-|
|
|`restore_keys`|||找不到完全相同的 key 時,依序嘗試的前綴(每行一個),例如 ci-home-|
|
||||||
|`path`||`.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: ./` 實際執行一次。
|
- CI(`ci.yaml`):用 [action-ci](https://gitea.jsc.idv.tw/actions/action-ci),並用 `uses: ./` 實際執行一次。
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
name: ci-cache
|
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:
|
inputs:
|
||||||
key:
|
key:
|
||||||
description: "快取 key,例如 ci-home-${{ hashFiles('go.sum', 'web/package-lock.json') }}"
|
description: "快取 key,例如 ci-home-${{ hashFiles('go.sum', 'web/package-lock.json') }}"
|
||||||
@@ -13,7 +13,7 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@${{ vars.ACTION_CACHE_VERSION }}
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.path }}
|
path: ${{ inputs.path }}
|
||||||
key: ${{ inputs.key }}
|
key: ${{ inputs.key }}
|
||||||
|
|||||||
Reference in New Issue
Block a user