Skip to content

Commit

Permalink
ci: add workflows (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Mar 15, 2024
1 parent c0835d7 commit dfa5718
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
push:
branches: [master]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build app
run: |
yarn
yarn rollup -c
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist
27 changes: 27 additions & 0 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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 }}

# Currently, only npm supports publishing packages with provenance
# https://docs.npmjs.com/generating-provenance-statements
run: |
npm install --force
npm publish --provenance --access public
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"types": "./types/index.d.ts",
"scripts": {
"dev": "rollup -cw",
"predeploy": "rollup -c",
"deploy": "npx gh-pages -d dist",
"test": "svelte-check --workspace=test"
},
"devDependencies": {
Expand Down

0 comments on commit dfa5718

Please sign in to comment.