feat: build and publish docker image
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m4s

This commit is contained in:
Pihkaal
2025-12-21 14:04:38 +01:00
parent 68ae4b4d2a
commit 19b9f62c46
4 changed files with 57 additions and 0 deletions

7
.dockerignore Normal file
View File

@@ -0,0 +1,7 @@
node_modules
dist
.git
.gitea
.env
*.log
README.md

View File

@@ -0,0 +1,29 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.pihkaal.xyz
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t git.pihkaal.xyz/pihkaal/gitea-auto-urls:latest .
docker push git.pihkaal.xyz/pihkaal/gitea-auto-urls:latest

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM node:20-alpine
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN corepack enable && corepack prepare pnpm@10.25.0 --activate
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build
EXPOSE 3000
CMD ["node", "dist/index.js"]

View File

@@ -5,6 +5,11 @@ const app = express();
app.use(express.json()); app.use(express.json());
app.post("/", (req, res) => {
console.log(req);
res.sendStatus(200);
});
app.listen(env.PORT, () => { app.listen(env.PORT, () => {
console.log(`Server running on port ${env.PORT}`); console.log(`Server running on port ${env.PORT}`);
}); });