mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 23:55:20 +00:00
8fb6d7465f
Co-authored-by: Nicolas Dorseuil <nicolas@gitbook.io>
43 lines
1.5 KiB
YAML
43 lines
1.5 KiB
YAML
name: Publish
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
NPM_TOKEN_READONLY: ${{ secrets.NPM_TOKEN_READONLY }}
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
jobs:
|
|
publish:
|
|
name: Publish
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
|
|
fetch-depth: 0
|
|
- name: Setup Bun
|
|
uses: ./.github/composite/setup-bun
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
env:
|
|
PUPPETEER_SKIP_DOWNLOAD: 1
|
|
- name: Create Release Pull Request or Publish to npm
|
|
id: changesets
|
|
uses: changesets/action@v1
|
|
with:
|
|
publish: npm run release
|
|
version: npm run changeset-version
|
|
env:
|
|
# Using a PAT instead of GITHUB_TOKEN because we need to run workflows when releases are created
|
|
# https://github.com/orgs/community/discussions/26875#discussioncomment-3253761
|
|
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
|