Merge pull request #126 from Acurast/feat/cancel-deployment #82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Prod | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_run: | |
| workflows: ['Build'] | |
| types: | |
| - completed | |
| workflow_dispatch: | |
| inputs: | |
| target: | |
| description: 'Publish prod' | |
| required: true | |
| default: 'prod' | |
| type: choice | |
| options: | |
| - prod | |
| jobs: | |
| publish: | |
| name: π Publish to npm | |
| runs-on: ubuntu-latest | |
| if: github.event.inputs.target == 'prod' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: βοΈ Set up Node.js ${{ env.node_version }} | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ env.node_version }} | |
| - name: π§ Install dependencies | |
| run: npm ci | |
| - name: ποΈ Build | |
| run: npm run build | |
| - name: π Authenticate to npm | |
| run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
| - name: π Publish to npm | |
| run: npm publish --access=public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |