Skip to content

Commit

Permalink
chore: deploy to coolify
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Oct 23, 2024
1 parent d8a21b0 commit 369f1a4
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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 }}'
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nginx:alpine
EXPOSE 80
COPY ./docs/.vitepress/dist /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/nginx.conf
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 369f1a4

Please sign in to comment.