Closed FossPrime closed 1 year ago
DERP... this isn't possible because of the COOP requirement.
Basically your server needs to have the require corp header... which github does not have.
Turns out you can use Github pages for hosting... but you'll have to use Cloudflare DNS's Transform Rules to attach the headers.
... We could have a redirect that does this for everyone...
How to setup with github pages + cloudflare DNS:
Cross-Origin-Embedder-Policy = require-corp
and Cross-Origin-Opener-Policy = same-origin
# Simple workflow for deploying static content to GitHub Pages
name: Deploy to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ['master']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
env:
VITE_BASE: ${{github.event.repository.name}}/
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: latest
- run: pnpm i --fix-lockfile # Fix version differences
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'pnpm'
- name: Install dependencies
run: npm i -g @antfu/ni && ni
- name: Build
run: npx vite build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
I can't relink this PR so redoing in new PR. It needed to be a master PR because... Pages.
Useful as a bare minimum check on PR's at the moment. And also the fast sanity check when reading build instructions...