diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..bc884a7 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,44 @@ +name: ci + +on: + push: + branches: + - main + +jobs: + docker_image: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Install Docker + run: curl -fsSL https://get.docker.com | sh + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: git.marinodev.com + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push Docker Image + uses: docker/build-push-action@v6 + with: + push: true + tags: git.marinodev.com/marinodev/FBLA25:latest + + deploy: + runs-on: ubuntu-latest + needs: docker_image + steps: + - name: Restart Service + uses: https://github.com/appleboy/ssh-action@v1.0.3 + with: + host: ${{ vars.DEPLOY_HOST }} + username: ${{ vars.DEPLOY_USER }} + password: ${{ secrets.DEPLOY_PASSWORD }} + script: | + cd ${{ vars.DEPLOY_PATH }} + git pull + docker-compose down && docker-compose pull && docker-compose up -d \ No newline at end of file diff --git a/.gitignore b/.gitignore index dbf4cf2..1d0f077 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ Thumbs.db # Vite vite.config.js.timestamp-* vite.config.ts.timestamp-* + +# Postgres +postgresql diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ccec4cf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM git.marinodev.com/MarinoDev/node_gitea_ci:latest + +RUN cd /srv && \ + git clone https://git.marinodev.com/MarinoDev/FBLA25.git +WORKDIR /srv/FBLA25 + +RUN npm ci --omit dev +RUN npm run build + +EXPOSE 8080 +ENTRYPOINT cd /srv/FBLA25 && PORT=8080 node build diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0fa1bfd --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.8' + +services: + postgres: + image: postgres:17 + restart: unless-stopped + environment: + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: /run/secrets/postgres_password + ports: + - "5433:5432" + volumes: + - ./postgresql/data:/var/lib/postgresql/data + FBLA25: + image: git.marinodev.com/marinodev/FBLA25 + restart: on-failure + ports: + - "8002:8080" + +secrets: + postgres_password: + file: ./postgres/postgres_password.txt diff --git a/package-lock.json b/package-lock.json index 00180b3..eef9d32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "globals": "^15.0.0", "prettier": "^3.3.2", "prettier-plugin-svelte": "^3.2.6", - "prettier-plugin-tailwindcss": "^0.6.5", + "prettier-plugin-tailwindcss": "^0.6.9", "svelte": "^5.0.0", "svelte-check": "^4.0.0", "tailwindcss": "^3.4.9", diff --git a/package.json b/package.json index e05d9a0..500a691 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "globals": "^15.0.0", "prettier": "^3.3.2", "prettier-plugin-svelte": "^3.2.6", - "prettier-plugin-tailwindcss": "^0.6.5", + "prettier-plugin-tailwindcss": "^0.6.9", "svelte": "^5.0.0", "svelte-check": "^4.0.0", "tailwindcss": "^3.4.9", diff --git a/src/app.css b/src/app.css index a31e444..ceabe09 100644 --- a/src/app.css +++ b/src/app.css @@ -1,3 +1,29 @@ @import 'tailwindcss/base'; @import 'tailwindcss/components'; @import 'tailwindcss/utilities'; + +:root { + --text-color: #000000; + --bg-color: #f4f4f4; +} + +[data-theme='dark'] { + --text-color: #f4f4f4; + --bg-color: #010101; +} + +body { + background: var(--bg-color); + color: var(--text-color); +} + +h1 { + color: var(--text-color); + @apply text-4xl +} + +a { + @apply text-blue-500 +} + + diff --git a/src/app.html b/src/app.html index 9c5baff..ea96c07 100644 --- a/src/app.html +++ b/src/app.html @@ -9,6 +9,7 @@ %sveltekit.head%
+