1- # Simple workflow for deploying static content to GitHub Pages
2- name : Deploy static content to Pages
3-
1+ name : Deploy SvelteKit Site to GitHub Pages (with Deno)
42
53on :
6- # Runs on pushes targeting the default branch
74 push :
8- branches : ["main"]
9-
10- # Allows you to run this workflow manually from the Actions tab
11- workflow_dispatch :
5+ branches : ["main"] # Trigger deployment on pushes to the main branch
6+ workflow_dispatch : # Allows manual triggering
127
138# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
149permissions :
15- contents : write
10+ contents : read
1611 pages : write
1712 id-token : write
1813
19- # Allow one concurrent deployment
14+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2016concurrency :
2117 group : " pages"
22- cancel-in-progress : true
18+ cancel-in-progress : false
2319
2420jobs :
25- # Single deploy job since we're just deploying
26- deploy :
27- environment :
28- name : github-pages
29- url : ${{ steps.deployment.outputs.page_url }}
21+ build :
3022 runs-on : ubuntu-latest
3123 steps :
3224 - name : Checkout
33- uses : actions/checkout@v3
25+ uses : actions/checkout@v4
26+
27+ - name : Setup Deno
28+ uses : denoland/setup-deno@v2
29+ with :
30+ deno-version : v2.1.4
31+
32+ - name : Install Dependencies
33+ # Use Deno to run npm install. Adjust if you use pnpm or yarn.
34+ run : deno run -A npm:npm install
35+
36+ - name : Build SvelteKit Site
37+ # Use Deno to run npm run build.
38+ # Set the VITE_BASE_PATH environment variable for GitHub Pages sub-paths.
39+ run : deno run -A npm:npm run build
40+ env :
41+ VITE_BASE_PATH : /${{ github.event.repository.name }} # Set this to your repo name!
42+
43+ - name : Create .nojekyll file
44+ # Prevents GitHub Pages from running built files through Jekyll
45+ run : touch build/.nojekyll
46+
3447 - name : Setup Pages
35- uses : actions/configure-pages@v1
36- - name : Install and Build 🔧
37- run : |
38- npm ci
39- npm run build
40- - name : Deploy 🚀
41- uses : JamesIves/github-pages-deploy-action@v4
48+ uses : actions/configure-pages@v5
49+
50+ - name of : Upload artifact
51+ uses : actions/upload-pages-artifact@v3
4252 with :
43- folder : build # The folder the action should deploy.
53+ # Upload the 'build' directory (or whatever you set in svelte.config.js)
54+ path : ' ./build'
4455
56+ deploy :
57+ environment :
58+ name : github-pages
59+ url : ${{ steps.deployment.outputs.page_url }}
60+ runs-on : ubuntu-latest
61+ needs : build # This job runs only after the 'build' job succeeds
62+ steps :
63+ - name : Deploy to GitHub Pages
64+ id : deployment
65+ uses : actions/deploy-pages@v4
0 commit comments