From 516f3909eeff8968be629611fe7fa4088ebed4be Mon Sep 17 00:00:00 2001 From: Vadim Date: Wed, 25 Mar 2026 09:50:35 +0300 Subject: [PATCH] wip --- .gitea/workflows/deploy.yaml | 35 ++++++++++++++++++----------------- Dockerfile | 15 ++++----------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index e679b3e..eba8c9d 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,26 +1,27 @@ name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +run-name: Deploy 🚀 on: push: branches: - - dev - + - main jobs: Explore-Gitea-Actions: runs-on: ubuntu-latest steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event.." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner!" -# - name: List files in the repository -# run: | -# ls ${{ gitea.workspace }} -# docker run -d --name tracker -p 3300:3000 git.madsky.ru/vadim/tracker:latest - - name: List files in the repository + - name: Checkout repository + uses: actions/checkout@v6 + - name: Docker build + run: docker build --tag git.madsky.ru/vadim/socket-service . + - name: Login to gitea + uses: docker/login-action@v4 + with: + registry: git.madsky.ru + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + - name: Push Docker image to gitea registry run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file + IMAGE_TAG="git.madsky.ru/vadim/socket-service:${{ gitea.sha }}" + docker tag git.madsky.ru/vadim/socket-service $IMAGE_TAG + docker push $IMAGE_TAG + - name: Ready + run: echo "Success!" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4365359..f4ecd64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,10 @@ #FROM node:lts-alpine FROM oven/bun:canary-alpine WORKDIR /app - -COPY package*.json ./ -RUN npm install +COPY package.json ./ +COPY package.json bun.lock ./ +RUN bun install --frozen-lockfile COPY . . - -RUN npm run build - -RUN apk add --no-cache tzdata ENV NODE_ENV=production -ENV TZ=Europe/Moscow - -CMD ["node", "dist/main"] EXPOSE 3000/tcp -ENTRYPOINT [ "bun", "run", "index.ts" ] +ENTRYPOINT [ "bun", "run", "src/index.ts" ]