probando workflow
Some checks failed
build-and-push / build (push) Failing after 5s

This commit is contained in:
2025-05-02 15:45:56 -06:00
parent 3820ad8f4e
commit ededdf9ae8
3 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
name: build-and-push
on:
push:
branches: [ main ]
jobs:
build:
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to registry
uses: docker/login-action@v2
with:
registry: gitea.interno.com
username: nucleo000
password: 7bc7b2fcd283bd6a251bef3ede368b7f897c919d
- name: Build
run: docker build -t gitea.interno.com/nucleo000/planilla:${{ github.sha }} -t gitea.interno.com/nucleo000/planilla:latest ./nucleo-bot
- name: Push
run: |
docker push gitea.interno.com/nucleo000/planilla:${{ github.sha }}
docker push gitea.interno.com/nucleo000/planilla:latest

19
Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
# Dockerfile actualizado
FROM node:23-slim
WORKDIR /app
# 1) Copiás sólo package.json (y package-lock.json si existe) para aprovechar cache
COPY package.json package-lock.json* ./
RUN npm install --omit=dev
# 2) Copiás el resto del código (todos los .js y módulos separados)
COPY . .
# 3) Variables y puerto
ENV PORT=4000
EXPOSE 4000
# 4) Arranque
CMD ["node", "index.js"]

11
index.js Normal file
View File

@@ -0,0 +1,11 @@
const http = require('http');
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World\n');
});
const PORT = 3000;
server.listen(PORT, () => {
console.log(`Servidor corriendo en http://localhost:${PORT}`);
});