Skip to content

publish-stable-npm #102

publish-stable-npm

publish-stable-npm #102

name: publish-stable-npm
on:
repository_dispatch:
types: [publish-stable-npm]
jobs:
npm-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Deploy on NPM
run: |
yarn install --ignore-scripts
yarn build
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
IS_CI: "true"
publish-success:
runs-on: ubuntu-latest
needs: [npm-publish]
steps:
- name: Get deploy version
id: deployed-version
run: echo '::set-output name=SOURCE_TAG::$(curl https://api.github.com/repos/vtex/toolbelt/releases/latest -s | jq .tag_name -r)'
- name: Trigger slack notification bot [Success]
run: 'curl --connect-timeout 30 --retry 3 --retry-delay 120 --data "status=success&user=${{ github.actor }}&platform=NPM&version=${{ steps.deployed-version.outputs.SOURCE_TAG }}" --header "token: ${{ secrets.TOOLBELT_NOTIFICATION_KEY }}" https://master--vtex.myvtex.com/_v/public/toolbelt-notification/status'
publish-failed:
runs-on: ubuntu-latest
needs: [npm-publish]
if: failure()
steps:
- name: Get deploy version
id: deployed-version
run: echo '::set-output name=SOURCE_TAG::$(curl https://api.github.com/repos/vtex/toolbelt/releases/latest -s | jq .tag_name -r)'
- name: Trigger slack notification bot [Fail]
run: 'curl --connect-timeout 30 --retry 3 --retry-delay 120 --data "status=failed&user=${{ github.actor }}&platform=NPM&version=${{ steps.deployed-version.outputs.SOURCE_TAG }}" --header "token: ${{ secrets.TOOLBELT_NOTIFICATION_KEY }}" https://master--vtex.myvtex.com/_v/public/toolbelt-notification/status'