48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
name: Publicar Paquete SigPro (NPM)
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
# AÑADIMOS ESTO (Igual que en tu Deploy Docs)
|
|
container:
|
|
image: node:20-bullseye
|
|
options: >-
|
|
--dns 192.168.1.1
|
|
--add-host git.natxocc.com:host-gateway
|
|
--add-host gitea:host-gateway
|
|
|
|
steps:
|
|
- name: Checkout código
|
|
uses: actions/checkout@v4
|
|
env:
|
|
# Tu truco de GIT_CONFIG_PARAMETERS es genial, mantenlo
|
|
GIT_CONFIG_PARAMETERS: "'url.https://git.natxocc.com/.insteadOf=http://gitea:3000/'"
|
|
|
|
- name: Instalar Bun
|
|
run: |
|
|
curl -fsSL https://bun.sh/install | bash
|
|
echo "$HOME/.bun/bin" >> $GITHUB_PATH
|
|
# Nota: Usamos comando directo porque algunas Actions de terceros
|
|
# a veces fallan dentro de contenedores personalizados.
|
|
|
|
- name: Instalar dependencias
|
|
run: |
|
|
export PATH="$HOME/.bun/bin:$PATH"
|
|
bun install
|
|
|
|
- name: Ejecutar Build
|
|
run: |
|
|
export PATH="$HOME/.bun/bin:$PATH"
|
|
bun run build
|
|
|
|
- name: Configurar Registro Gitea y Publicar
|
|
run: |
|
|
echo "@natxocc:registry=https://git.natxocc.com/api/packages/natxocc/npm/" >> .npmrc
|
|
echo "//git.natxocc.com/api/packages/natxocc/npm/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
|
|
npm publish |