27 lines
1.1 KiB
YAML
27 lines
1.1 KiB
YAML
name: ci-run
|
|
description: "跑一個 CI 工作:還原快取(ci-cache)→ 在 ci-env 容器裡執行指令。內部用的 ci-cache、ci-env 版本取自呼叫端的 Gitea 變數 ACTION_CI_CACHE_VERSION、ACTION_CI_ENV_VERSION。要在 checkout 之後使用,需要工具鏈時呼叫的工作流要有 env: GO_VERSION、NODE_VERSION"
|
|
inputs:
|
|
command:
|
|
description: "要在 ci-env 容器裡執行的 shell 指令"
|
|
required: true
|
|
cache_key:
|
|
description: "快取 key,例如 ci-home-${{ hashFiles('go.sum', 'web/package-lock.json') }}"
|
|
required: true
|
|
cache_restore_keys:
|
|
description: "找不到完全相同的 key 時,依序嘗試的前綴(每行一個)"
|
|
default: ""
|
|
name:
|
|
description: "執行指令的步驟名稱"
|
|
default: ci
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- uses: https://gitea.jsc.idv.tw/actions/ci-cache@${{ vars.ACTION_CI_CACHE_VERSION }}
|
|
with:
|
|
key: ${{ inputs.cache_key }}
|
|
restore_keys: ${{ inputs.cache_restore_keys }}
|
|
- name: ${{ inputs.name }}
|
|
uses: https://gitea.jsc.idv.tw/actions/ci-env@${{ vars.ACTION_CI_ENV_VERSION }}
|
|
with:
|
|
command: ${{ inputs.command }}
|