mirror of
https://github.com/suyu-emu/website.git
synced 2026-09-21 14:17:45 -07:00
113 lines
3.4 KiB
YAML
113 lines
3.4 KiB
YAML
name: Deploy Svelte Site to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches: [dev]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
PUB_KEY: ${{ secrets.PUB_KEY }}
|
|
HCAPTCHA_KEY: ${{ secrets.HCAPTCHA_KEY }}
|
|
PUBLIC_SITE_KEY: 001ad710-986e-4664-91e8-b324618a2146
|
|
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
pages: write
|
|
contents: write
|
|
id-token: write
|
|
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
steps:
|
|
- name: Clear npm cache
|
|
run: npm cache clean --force
|
|
|
|
- name: Clear Dependency Cache
|
|
run: rm -rf node_modules package-lock.json && npm cache clean --force
|
|
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
|
|
- name: Install Dependencies
|
|
run: npm install --legacy-peer-deps
|
|
|
|
- name: Svelte Kit Latest Installation
|
|
run: npm install @sveltejs/kit@latest --legacy-peer-deps
|
|
|
|
- name: Install Pages Adapter
|
|
run: npm install @sveltejs/adapter-static@latest --legacy-peer-deps
|
|
|
|
- name: Install Cheerio
|
|
run: npm install cheerio --legacy-peer-deps
|
|
|
|
- name: Flowbite Version Check
|
|
run: npm show flowbite-svelte-icons versions
|
|
|
|
- name: Install Specific Version of flowbite-svelte-icons
|
|
run: npm install flowbite-svelte-icons@1 --legacy-peer-deps
|
|
|
|
- name: Bar3Icon stuff
|
|
run: npm i svelte-hero-icons --save-dev
|
|
|
|
- name: svelte simple icons
|
|
run: npm i svelte-simple-icons --save-dev
|
|
|
|
- name: svelte-heros-v2
|
|
run: npm install svelte-heros-v2 @icons-pack/svelte-simple-icons --legacy-peer-deps
|
|
|
|
- name: Flowbite check
|
|
run: npm ls flowbite-svelte-icons
|
|
|
|
- name: Install pnpm
|
|
run: npm install -g pnpm
|
|
|
|
- name: Browserlist Fix
|
|
run: npx update-browserslist-db@latest --legacy-peer-deps
|
|
|
|
- name: Rebuild Native Modules
|
|
run: npm rebuild bcrypt --build-from-source
|
|
|
|
- name: Verify bcrypt Installation
|
|
run: ls -l node_modules/.pnpm/bcrypt*
|
|
|
|
- name: Build the Site
|
|
env:
|
|
HCAPTCHA_KEY: ${{ secrets.HCAPTCHA_KEY }}
|
|
PUBLIC_SITE_KEY: 001ad710-986e-4664-91e8-b324618a2146
|
|
run: npm run build -- --mode production
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: github-pages
|
|
path: build
|
|
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|
|
|
|
|
|
- name: Configure GitHub Pages
|
|
uses: actions/configure-pages@v5.0.0
|
|
with:
|
|
# Optional static site generator to attempt to configure: "nuxt", "next", "gatsby", or "sveltekit"
|
|
static_site_generator: sveltekit
|
|
# Optional file path to static site generator configuration file
|
|
|
|
# GitHub token
|
|
token: ${{ github.token }}
|
|
# Try to enable Pages for the repository if it is not already enabled. This option requires a token other than `GITHUB_TOKEN` to be provided. In the context of a Personal Access Token, the `repo` scope or Pages write permission is required. In the context of a GitHub App, the `administration:write` and `pages:write` permissions are required.
|
|
enablement: true
|
|
|