Updated some Gh pages errors #102
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
BASE_URL: '/' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
ci: | |
name: Continuous Integration | |
runs-on: ubuntu-latest | |
environment: github-pages | |
env: | |
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} | |
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install --force | |
- name: Verify terser installation | |
run: | | |
echo "Checking terser..." | |
npm list terser | |
npm install [email protected] --save-dev | |
- name: Run tests | |
run: npm run test:ci | |
- name: Build project | |
run: | | |
echo "VITE_SUPABASE_URL=$VITE_SUPABASE_URL" | |
echo "VITE_SUPABASE_ANON_KEY=${VITE_SUPABASE_ANON_KEY:0:10}..." | |
npm run build:ci | |
npm run postbuild | |
- name: Verify build output | |
run: | | |
echo "Listing dist contents:" | |
ls -R dist | |
echo "Checking index.html:" | |
cat dist/index.html | |
echo "Asset paths:" | |
cat dist/index.html | grep "assets" || echo "No assets found" | |
echo "Checking Material Symbols:" | |
cat dist/index.html | grep "Material+Symbols" || echo "Material Symbols not found in index.html" | |
- name: Create .nojekyll file | |
run: touch dist/.nojekyll | |
- name: Create _headers file | |
run: | | |
echo "/*" > dist/_headers | |
echo " X-Frame-Options: DENY" >> dist/_headers | |
echo " X-Content-Type-Options: nosniff" >> dist/_headers | |
echo " X-XSS-Protection: 1; mode=block" >> dist/_headers | |
echo " Referrer-Policy: strict-origin-when-cross-origin" >> dist/_headers | |
echo " Permissions-Policy: camera=(), microphone=(), geolocation=()" >> dist/_headers | |
echo " Strict-Transport-Security: max-age=31536000; includeSubDomains; preload" >> dist/_headers | |
echo " Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src 'self' data:; connect-src 'self' https://*.supabase.co; frame-ancestors 'none'" >> dist/_headers | |
echo "/index.html" >> dist/_headers | |
echo " Cache-Control: no-cache" >> dist/_headers | |
echo "/200.html" >> dist/_headers | |
echo " Cache-Control: no-cache" >> dist/_headers | |
echo "/404.html" >> dist/_headers | |
echo " Cache-Control: no-cache" >> dist/_headers | |
echo "/assets/*.*" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/vendor-*.js" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/vendor-*.css" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/home-*.js" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/home-*.css" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/workflow-*.js" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/workflow-*.css" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/index-*.js" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/index-*.css" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/components-*.js" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/state-*.js" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/documentation-*.js" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/assets/documentation-*.css" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/fonts/*" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/*.ico" >> dist/_headers | |
echo " Content-Type: image/x-icon" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/*.png" >> dist/_headers | |
echo " Content-Type: image/png" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/*.svg" >> dist/_headers | |
echo " Content-Type: image/svg+xml" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/*.webp" >> dist/_headers | |
echo " Content-Type: image/webp" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/*.woff" >> dist/_headers | |
echo " Content-Type: font/woff" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/*.woff2" >> dist/_headers | |
echo " Content-Type: font/woff2" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
echo "/*.ttf" >> dist/_headers | |
echo " Content-Type: font/ttf" >> dist/_headers | |
echo " Cache-Control: public, max-age=31536000, immutable" >> dist/_headers | |
- name: Download and prepare Material Icons font | |
run: | | |
mkdir -p dist/fonts | |
curl -sSL https://fonts.gstatic.com/s/materialsymbolsoutlined/v230/kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsLjBuVY.woff2 -o dist/fonts/material-symbols.woff2 | |
cp public/fonts/material-icons.css dist/fonts/ | |
echo "Material Icons font downloaded and included in the build" | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist | |
deploy: | |
name: Deploy to GitHub Pages | |
needs: ci | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |