From aa4ec2baf884ceb985942b72e91f8857a2edd5a2 Mon Sep 17 00:00:00 2001 From: Sebastien Graf Date: Wed, 14 Feb 2024 14:50:10 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20update=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gh-pages.yml | 8 ++++++-- public/.htaccess | 20 ++++++++++++++++++++ public/sw.js | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 public/.htaccess diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 38d649f..8bd544d 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -3,7 +3,8 @@ name: Deploy on: push: branches: - - dev-2024 + - main-2024 + - dev concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,9 +16,12 @@ jobs: - name: Set deployment environment variables based on Git branches id: deploy_target run: | - if [[ $GITHUB_REF == 'refs/heads/dev-2024' ]]; then + if [[ $GITHUB_REF == 'refs/heads/dev' ]]; then echo "DEPLOY_TARGET=sites/staging.associationgrand.ch" >> $GITHUB_ENV fi + if [[ $GITHUB_REF == 'refs/heads/main-2024' ]]; then + echo "DEPLOY_TARGET=sites/associationgrand.ch" >> $GITHUB_ENV + fi - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..9d68188 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,20 @@ +# +# Cache strategy +# + + + Header set Cache-Control "no-store" + + + Header set Cache-Control "public, max-age=604800, must-revalidate" + + + Header set Cache-Control "public, max-age=600, must-revalidate" + + + Header set Cache-Control "public, max-age=300, must-revalidate" + + + +SetOutputFilter DEFLATE +AddOutputFilterByType DEFLATE "application/atom+xml" "application/javascript" "application/json" "application/ld+json" "application/manifest+json" "application/rdf+xml" "application/rss+xml" "application/schema+json" "application/vnd.geo+json" "application/vnd.ms-fontobject" "application/x-font-ttf" "application/x-javascript" "application/x-web-app-manifest+json" "application/xhtml+xml" "application/xml" "font/eot" "font/opentype" "image/bmp" "image/svg+xml" "image/vnd.microsoft.icon" "image/x-icon" "text/cache-manifest" "text/css" "text/html" "text/javascript" "text/plain" "text/vcard" "text/vnd.rim.location.xloc" "text/vtt" "text/x-component" "text/x-cross-domain-policy" "text/xml" diff --git a/public/sw.js b/public/sw.js index e2a75b1..f518ef1 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,6 +1,6 @@ 'use strict'; -const version = '20240214-'; +const version = '20240215'; const staticCacheName = version + 'static'; const pagesCacheName = 'pages'; const imagesCacheName = 'images';