File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,12 +99,12 @@ jobs:
9999 if [ $? -ne 0 ]; then echo "File sync failed"; exit 1; fi
100100 shell : bash
101101
102- - name : Copy docker-compose.yml to server
102+ - name : Copy docker-compose.yml and nginx.conf to server
103103 run : |
104104 set -x
105- echo "Copying docker-compose.yml to server..."
106- scp docker-compose.yml ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/
107- if [ $? -ne 0 ]; then echo "Failed to copy docker-compose.yml "; exit 1; fi
105+ echo "Copying docker-compose.yml and nginx.conf to server..."
106+ scp docker-compose.yml nginx.conf ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/
107+ if [ $? -ne 0 ]; then echo "Failed to copy files "; exit 1; fi
108108 shell : bash
109109
110110 - name : Deploy docs with Docker Compose
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ services:
77 restart : unless-stopped
88 volumes :
99 - /opt/services/docs.basekick.net:/usr/share/nginx/html:ro
10+ - /opt/services/docs.basekick.net/nginx.conf:/etc/nginx/conf.d/default.conf:ro
1011 networks :
1112 - traefik
1213 labels :
Original file line number Diff line number Diff line change 1+ server {
2+ listen 80 ;
3+ server_name docs.basekick.net;
4+ root /usr/share/nginx/html/build;
5+ index index .html;
6+
7+ # Enable gzip compression
8+ gzip on;
9+ gzip_vary on;
10+ gzip_min_length 1024 ;
11+ gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
12+
13+ # Cache static assets
14+ location ~ * \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
15+ expires 1y ;
16+ add_header Cache-Control "public, immutable" ;
17+ }
18+
19+ # Try to serve file directly, fallback to index.html for client-side routing
20+ location / {
21+ try_files $uri $uri / $uri .html /404 .html;
22+ }
23+
24+ # Disable directory listing
25+ autoindex off;
26+
27+ # Security headers
28+ add_header X-Frame-Options "SAMEORIGIN" always;
29+ add_header X-Content-Type-Options "nosniff" always;
30+ add_header X-XSS-Protection "1; mode=block" always;
31+ }
You can’t perform that action at this time.
0 commit comments