From 369f1a4fc8793c376d713218d9f27113c06b43f7 Mon Sep 17 00:00:00 2001 From: Kael Date: Wed, 23 Oct 2024 17:09:56 +1100 Subject: [PATCH] chore: deploy to coolify --- .github/workflows/docs.yml | 39 ++++++++++++++++++++++++++++++++++++ Dockerfile | 4 ++++ docker-compose.yml | 8 ++++++++ nginx.conf | 41 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..95c81c3 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,39 @@ +name: Docs +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + environment: Production + if: github.event_name == 'push' && github.repository_owner == 'vuetifyjs' && github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + cache: 'pnpm' + node-version-file: '.nvmrc' + - run: pnpm i --frozen-lockfile + - run: pnpm run docs:build + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/vuetifyjs/nuxt-module + - uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + - name: Deploy to Coolify + run: | + curl --request GET '${{ secrets.COOLIFY_WEBHOOK }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}' diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..416138b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:alpine +EXPOSE 80 +COPY ./docs/.vitepress/dist /usr/share/nginx/html +COPY ./nginx.conf /etc/nginx/nginx.conf diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6baea24 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + docs: + image: nginx:alpine + ports: + - ${PORT:-5173}:80 + volumes: + - ./docs/.vitepress/dist:/usr/share/nginx/html + - ./nginx.conf:/etc/nginx/nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..7d67535 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,41 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + root /usr/share/nginx/html; + + sendfile on; + tcp_nopush on; + + keepalive_timeout 65; + + server { + listen 80; + server_name localhost; + + charset utf-8; + + location / { + index index.html; + try_files $uri $uri.html $uri/ =404; + add_header Cache-Control 'public, max-age=3600, s-maxage=60'; + } + + location /assets/ { + add_header Cache-Control 'public, immutable, max-age=31536000, stale-if-error=604800'; + } + + location = /service-worker.js { + add_header Cache-Control 'public, max-age=0, s-maxage=60, must-revalidate'; + } + + error_page 404 /404.html; + error_page 403 /404.html; + #error_page 500 502 503 504 /50x.html; + } +}