Skip to content

v1.9.49-test | Commit automático #73

v1.9.49-test | Commit automático

v1.9.49-test | Commit automático #73

Workflow file for this run

name: Deploy no NPM
on:
push:
branches:
- main # Branch principal para publicação de versões estáveis
- test # Branch para publicação de versões de teste
jobs:
publish:
name: Deploy e publicação para NPM
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Build the library and add tags
run: npm run build
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Usando o token armazenado nos secrets
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
cd dist/ngx-sp-infra
# Condicional para definir a tag de publicação
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
npm publish --access public --tag latest
elif [ "${{ github.ref }}" == "refs/heads/test" ]; then
npm publish --access public --tag test
fi