Skip to content

Commit

Permalink
upgrade actions; add publish workflow (#2026)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Mar 21, 2024
1 parent 70ee172 commit 4ec3572
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Expand Up @@ -16,17 +16,17 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn --frozen-lockfile
- run: yarn prepublishOnly
- run: yarn docs:build
- uses: actions/configure-pages@v3
- uses: actions/upload-pages-artifact@v1
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
- name: Deploy
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,25 @@
name: Publish

on:
workflow_dispatch: {}
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- run: yarn --frozen-lockfile
- run: yarn test
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
Expand All @@ -24,7 +24,7 @@ jobs:
- run: yarn test:prettier
- run: yarn prepublishOnly
- run: yarn docs:build
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-output-changes
Expand Down

0 comments on commit 4ec3572

Please sign in to comment.