Skip to content

Commit

Permalink
chore: publish docs to coolify
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Oct 6, 2024
1 parent 6173cab commit a9d2d7e
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 4 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
name: docs-dist
path: packages/docs/dist

publish-docs:
publish-docs-vercel:
needs: [lint, test-unit, build-docs]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository_owner == 'vuetifyjs' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/next')
Expand All @@ -153,3 +153,34 @@ jobs:
- run: node scripts/deploy-and-alias.js ${{ github.ref }}
env:
NOW_TOKEN: ${{ secrets.NOW_TOKEN }}

publish-docs-coolify:
needs: [lint, test-unit, build-docs]
runs-on: ubuntu-latest
environment: Production
if: github.event_name == 'push' && github.repository_owner == 'vuetifyjs' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/download-artifact
with:
name: docs-dist
- 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/docs
- uses: docker/build-push-action@v4
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 ./packages/docs/dist /usr/share/nginx/html
COPY ./packages/docs/build/nginx.conf /etc/nginx/nginx.conf
40 changes: 40 additions & 0 deletions packages/docs/build/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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/ /_fallback.html;
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 500 502 503 504 /50x.html;
}
}
4 changes: 1 addition & 3 deletions scripts/deploy-and-alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ if (child.code !== 0) {
}
const instanceUrl = child.stdout

setTimeout(() => {
shell.exec(`vercel alias set ${instanceUrl} ${alias} --scope=vuetifyjs --token=$NOW_TOKEN`, options)
}, 15_000)
shell.exec(`vercel alias set ${instanceUrl} ${alias} --scope=vuetifyjs --token=$NOW_TOKEN`, options)

0 comments on commit a9d2d7e

Please sign in to comment.