Skip to content

new endpoints

new endpoints #39

Workflow file for this run

# This file is automatically added by @npmcli/template-oss. Do not edit.
name: Publish
on:
push:
branches:
- main
pull_request:
paths:
- "api/**"
workflow_dispatch:
workflow_call:
permissions:
contents: read
id-token: write
pages: write
pull-requests: write
jobs:
build-and-deploy:
permissions:
contents: read
id-token: write
pages: write
pull-requests: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: Build and Deploy
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- name: Install dependencies
run: npm ci
- name: Build API docs
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
preview: ${{ github.event_name == 'pull_request' }}
- name: Comment PR with preview link
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const previewUrl = '${{ steps.deployment.outputs.page_url }}';
const comment = `🚀 **Preview deployed!**
You can view the preview of your changes here: ${previewUrl}
This preview will be updated automatically when you push new commits to this PR.`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});