From e1bbf193875fc6624c713f529aec8351eaeaee0b Mon Sep 17 00:00:00 2001 From: Beesquit Date: Thu, 16 Oct 2025 13:30:45 +0300 Subject: [PATCH] updated ci --- .dockerignore | 15 +++++ .gitea/workflows/docker-build-push.yaml | 49 ++++++++++++++ .gitignore | 89 +++++++++++++++++++++++++ README.md | 8 ++- compose.yml | 9 +++ dockerfile | 7 ++ 6 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 .dockerignore create mode 100644 .gitea/workflows/docker-build-push.yaml create mode 100644 .gitignore create mode 100644 dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..89080af --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +#.dockerignore +# Gitea +.gitea + +# Docker +.dockerignore +dockerfile +compose.yaml +compose.yml + +# Git +.gitignore +*.md +example.env +LICENSE diff --git a/.gitea/workflows/docker-build-push.yaml b/.gitea/workflows/docker-build-push.yaml new file mode 100644 index 0000000..efd3a91 --- /dev/null +++ b/.gitea/workflows/docker-build-push.yaml @@ -0,0 +1,49 @@ + +name: Build and Push Docker Image + +on: + release: + types: [published] + +env: + REGISTRY: git.frik.su + IMAGE_NAME: ${{ gitea.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Docker + run: curl -fsSL https://get.docker.com | sh + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract Docker tags from release + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=tag + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0aa4fd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,89 @@ +# compiled output +/dist +/tmp +/out-tsc + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# IDEs and editors +.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +.sass-cache +connect.lock +typings + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + + +# Dependency directories +node_modules/ +jspm_packages/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# Lerna +lerna-debug.log + +# System Files +.DS_Store +Thumbs.db diff --git a/README.md b/README.md index 184c00b..563f4fb 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,16 @@ services: image: git.frik.su/Beesquit/work-timerer:latest container_name: work-timerer ports: - 4000:80 - restart: unless stopped + - 4000:80 + volumes: + - ./src:/usr/share/nginx/html + restart: unless-stopped ``` The application should be available at the `localhost:4000` ### Todo: --[ ] Make travel time customizable with env +- [ ] Make travel time customizable with env ### Limitations: - The app is linked to the system time diff --git a/compose.yml b/compose.yml index e69de29..005d1d4 100644 --- a/compose.yml +++ b/compose.yml @@ -0,0 +1,9 @@ +services: + work-timerer: + image: git.frik.su/Beesquit/work-timerer:latest + container_name: work-timerer + ports: + - 4000:80 + volumes: + - ./src:/usr/share/nginx/html + restart: unless-stopped diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..da6c6ee --- /dev/null +++ b/dockerfile @@ -0,0 +1,7 @@ +FROM nginx:alpine + +WORKDIR /app + +COPY src/ /usr/share/nginx/html + +CMD ["nginx", "-g", "daemon off;"]