Skip to content

Commit

Permalink
Merge pull request #3 from antistatique/main-2024
Browse files Browse the repository at this point in the history
💚 update workflow
  • Loading branch information
Seb-GRAF authored Feb 14, 2024
2 parents c69aad8 + aa4ec2b commit f2513a6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Deploy
on:
push:
branches:
- dev-2024
- main-2024
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -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
Expand Down
20 changes: 20 additions & 0 deletions public/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Cache strategy
#
<IfModule mod_headers.c>
<FilesMatch "sw\.js$">
Header set Cache-Control "no-store"
</FilesMatch>
<FilesMatch "\.(css)$">
Header set Cache-Control "public, max-age=604800, must-revalidate"
</FilesMatch>
<FilesMatch "\.(webp|jpg|jpeg|png|gif|svg)$">
Header set Cache-Control "public, max-age=600, must-revalidate"
</FilesMatch>
<FilesMatch "\.(html)$">
Header set Cache-Control "public, max-age=300, must-revalidate"
</FilesMatch>
</IfModule>

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"
2 changes: 1 addition & 1 deletion public/sw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const version = '20240214-';
const version = '20240215';
const staticCacheName = version + 'static';
const pagesCacheName = 'pages';
const imagesCacheName = 'images';
Expand Down

0 comments on commit f2513a6

Please sign in to comment.