action.yml aktualisiert
This commit is contained in:
+11
-1
@@ -6,27 +6,37 @@
|
|||||||
# 'using: https://gitea.coursow.de/Test-Playground/actions-custom-composite@v1'
|
# 'using: https://gitea.coursow.de/Test-Playground/actions-custom-composite@v1'
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Name and Description of the Action (Like displayed in GitHub Marketplace Overview)
|
||||||
name: 'Get & Cache Dependencies'
|
name: 'Get & Cache Dependencies'
|
||||||
description: 'Get the Dependencies from the cache for a (npm) Node JS Project or initialize the cache for it'
|
description: 'Get the Dependencies from the cache for a (npm) Node JS Project or initialize the cache for it'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
caching:
|
||||||
|
description: 'If the cache should be used or not'
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite' # Must be 'composite' for a custom composite action
|
using: 'composite' # Must be 'composite' for a custom composite action
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
|
if: inputs.caching == 'true' # Using inputs from inputs section above...
|
||||||
with:
|
with:
|
||||||
go-version: '1.20'
|
go-version: '1.20'
|
||||||
- uses: actions/go-hashfiles@v0.0.1
|
- uses: actions/go-hashfiles@v0.0.1
|
||||||
id: get-cache-hash
|
id: get-cache-hash
|
||||||
|
if: inputs.caching == 'true'
|
||||||
with:
|
with:
|
||||||
patterns: |-
|
patterns: |-
|
||||||
**/package-lock.json
|
**/package-lock.json
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
id: cache
|
id: cache
|
||||||
|
if: inputs.caching == 'true'
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: node_modules
|
path: node_modules
|
||||||
key: deps-node-modules-${{ steps.get-cache-hash.outputs.hash }}
|
key: deps-node-modules-${{ steps.get-cache-hash.outputs.hash }}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true' || inputs.caching != 'true'
|
||||||
run: npm ci
|
run: npm ci
|
||||||
shell: bash # compared to workflow ymls... Action ymls require the 'shell' property when a 'run' property was used!
|
shell: bash # compared to workflow ymls... Action ymls require the 'shell' property when a 'run' property was used!
|
||||||
Reference in New Issue
Block a user