Skip to content

Commit 806a731

Browse files
push
1 parent 9d4eb4d commit 806a731

File tree

5,377 files changed

+175297
-132713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,377 files changed

+175297
-132713
lines changed

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [master]
10+
11+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
12+
jobs:
13+
# This workflow contains a single job called "build"
14+
build-and-deploy:
15+
# The type of runner that the job will run on
16+
runs-on: ubuntu-latest
17+
18+
# Steps represent a sequence of tasks that will be executed as part of the job
19+
steps:
20+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
- uses: actions/checkout@v2
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build
27+
run: npm run build
28+
29+
- name: Deploy
30+
uses: JamesIves/[email protected]
31+
with:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
BRANCH: gh-pages
34+
FOLDER: public

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
.idea
2-
.vscode/*
1+
/node_modules/
2+
/public/build/
3+
4+
.DS_Store
5+
.eslintcache

bin/prerender.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { existsSync, promises as fs } from 'fs'
2+
import { join } from 'path'
3+
4+
import App from '../src/App.svelte'
5+
6+
async function main() {
7+
const templatePath = join(process.cwd(), 'src', 'index.template')
8+
const publicPath = join(process.cwd(), 'public')
9+
10+
const template = await fs.readFile(templatePath)
11+
const app = App.render()
12+
13+
if (!existsSync(publicPath)) {
14+
await fs.mkdir(publicPath)
15+
}
16+
17+
await fs.writeFile(
18+
join(publicPath, 'index.html'),
19+
template.toString().replace('%svelte.head%', app.head).replace('%svelte.html%', app.html)
20+
)
21+
}
22+
23+
main()

0 commit comments

Comments
 (0)