actions/npm/publish/action.yaml

34 lines
974 B
YAML
Raw Normal View History

2023-12-13 22:51:26 -05:00
name: NPM Publish
description: Push to registry
inputs:
owner:
type: string
required: false
description: Owner to publish to
default: ${{github.repository_owner}}
2023-12-14 23:09:00 -05:00
registry:
type: string
required: false
description: NPM registry FQDM
default: ${{github.server_url}}/api/packages/${{inputs.owner}}/npm/
2023-12-13 22:51:26 -05:00
token:
type: string
required: false
description: Access Token
default: ${{secrets.DEPLOY_TOKEN}}
2023-12-14 22:36:42 -05:00
branch:
type: string
required: false
description: Only publish for branch
default: develop
2023-12-13 22:51:26 -05:00
runs:
using: composite
steps:
- name: Publish
2023-12-14 22:43:47 -05:00
if: ${{github.ref_name}} == ${{inputs.branch}}
2023-12-13 22:51:26 -05:00
uses: docker://node
with:
2023-12-14 23:40:59 -05:00
args: /bin/bash -c 'npm config set registry ${{inputs.registry}} && npm config set -- $(echo ${{inputs.registry}} | sed s%http:%% | sed s%https:%% ):_authToken "${{inputs.token}}" && npm publish || echo Already published...'