Skip to content

Commit

Permalink
ci: add github pages, publish workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed May 15, 2024
1 parent 2062041 commit a907ccb
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.8

- name: Install dependencies
run: bun install
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
branches: [master]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.8

- name: Install dependencies
run: bun install

- name: Build app
run: bun run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist
22 changes: 22 additions & 0 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: Publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: npm publish --provenance --access public
Binary file modified bun.lockb
Binary file not shown.
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
}
},
"scripts": {
"dev": "rollup -cw",
"predeploy": "rollup -c",
"deploy": "gh-pages -d dist",
"test": "svelte-check --workspace test"
"dev": "bun --bun rollup -cw",
"build": "bun --bun rollup -c",
"test": "bun --bun svelte-check --workspace test"
},
"devDependencies": {
"gh-pages": "^4.0.0",
"svelte": "^4.2.17",
"svelte-check": "^3.7.1",
"svelte-readme": "^3.6.3"
Expand Down

0 comments on commit a907ccb

Please sign in to comment.