Actualizar .github/workflows/publish.yml
This commit is contained in:
40
.github/workflows/publish.yml
vendored
40
.github/workflows/publish.yml
vendored
@@ -2,24 +2,42 @@ name: Publish to NPM
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published] # Se dispara cuando creas una "Release" en GitHub
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:20-bullseye
|
||||
options: >-
|
||||
--dns 192.168.1.1
|
||||
--add-host git.natxocc.com:host-gateway
|
||||
--add-host gitea:host-gateway
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Forzar Dominio Limpio
|
||||
run: |
|
||||
# Redirigimos cualquier intento (IP o nombre interno) al dominio limpio
|
||||
git config --global url."http://git.natxocc.com/".insteadOf "http://gitea:3000/"
|
||||
git config --global url."http://git.natxocc.com/".insteadOf "http://192.168.1.100:3333/"
|
||||
|
||||
git config --global --add safe.directory /workspace/natxocc/sigpro
|
||||
git config --global http.sslVerify false
|
||||
|
||||
- name: Checkout código
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
env:
|
||||
GIT_CONFIG_PARAMETERS: "'url.https://git.natxocc.com/.insteadOf=http://gitea:3000/'"
|
||||
|
||||
# Usamos Bun ya que tu proyecto lo usa
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Authenticate with NPM
|
||||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
|
||||
|
||||
- name: Publish to NPM
|
||||
run: npm publish --access public
|
||||
- name: Install & Publish
|
||||
run: |
|
||||
bun install
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
|
||||
npm publish --access public
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
Reference in New Issue
Block a user