feat: implement comprehensive PWA force update system
- Add UpdateManager and UpdateChecker for automatic version detection - Add post-build script for meta.json generation and version injection - Enhance Service Worker with version-aware caching - Add .htaccess configuration for proper cache control This ensures all users receive the latest version after deployment without manual cache clearing.
This commit is contained in:
47
.github/workflows/deploy-with-cache-purge.yml
vendored
Normal file
47
.github/workflows/deploy-with-cache-purge.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: Deploy Application
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build application
|
||||
run: npm run build
|
||||
|
||||
- name: Deploy to server
|
||||
# Добавьте ваш процесс деплоя здесь
|
||||
# Например: rsync, scp, FTP, etc.
|
||||
run: |
|
||||
echo "Deploying to server..."
|
||||
# Ваш скрипт деплоя
|
||||
# Пример для rsync:
|
||||
# rsync -avz --delete dist/ user@server:/var/www/securebit-chat/public/
|
||||
|
||||
# Автоматическая очистка кеша Cloudflare отключена
|
||||
# Для ручной очистки используйте: node scripts/purge-cloudflare-cache.js
|
||||
# Или очистите кеш через Cloudflare Dashboard
|
||||
|
||||
- name: Verify deployment
|
||||
run: |
|
||||
echo "✅ Deployment completed"
|
||||
echo "Note: Cloudflare cache purge is disabled. Clear cache manually if needed."
|
||||
|
||||
Reference in New Issue
Block a user