Quantcast
Channel: Node.jsタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 9146

【GitHub】GitHub Actionsで独自のActionを定義する

$
0
0
はじめに 最近、GitHub ActionsのWorkflowを構築するお仕事をしていたので、そこで発見したTipsについて書きます! 『同一リポジトリ内で同じActionを呼びたい』時に便利です! Node.jsのcomposite action composite action ・・・ ユーザーが独自に定義したAction .github/workflow/node/action.yml name: my-actions runs: using: 'composite' steps: - name: set up Node.js uses: actions/setup-node@v2 with: node-version: '14' cache: 'npm' # or 'yarn' cache-dependency-path: app/node/package-lock.json !!!注意!!! The metadata filename must be either action.yml or action.yaml. ファイル名はaction.ymlまたはaction.yamlでないといけないです! runs.using Required You must set this value to 'composite'. 独自でAcitonsを定義す時には、usign: compositeを付与しないといけないです! 呼び出し元のActions .github/workflows/test.yml name: Test on: push: jobs: test: name: Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ./.github/actions/node # 👈 ディレクトリを指定すると、呼び出すことができます🙌 備考 もうちょっと踏み込んだことがわかったら、追記します🙇‍♂️ 公式 composite action Metadata syntax for GitHub Actions

Viewing all articles
Browse latest Browse all 9146

Trending Articles