1
0
mirror of https://github.com/khrysse/khrysse.github.io.git synced 2025-06-27 14:41:54 +00:00
2025-06-09 03:50:55 +02:00

58 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Deploy to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build_site:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm install
- name: Build SvelteKit
env:
PUBLIC_GITHUB_API_URL: 'https://api.github.com'
PUBLIC_GITHUB_USERNAME: ${{ github.repository_owner }}
# ajoute ici le BASE_PATH si besoin (ex : '/mon-repo')
BASE_PATH: ''
run: |
echo "PUBLIC_GITHUB_API_URL=https://api.github.com" >> .env
echo "PUBLIC_GITHUB_USERNAME=${{ github.repository_owner }}" >> .env
echo "BASE_PATH=${BASE_PATH}" >> .env
npm run build
- name: Upload build folder
uses: actions/upload-pages-artifact@v3
with:
path: 'build/'
deploy:
needs: build_site
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4