Merge pull request #9 from reuters-graphics/changeset-release/main #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release: | |
if: github.repository == 'reuters-graphics/sportlich' | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- id: checkout | |
name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: pnpm | |
name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 8.x | |
- id: setup | |
name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- id: install | |
name: Install dependencies | |
run: pnpm i | |
- id: changesets | |
name: Create Release Pull Request or Publish to npm | |
uses: changesets/action@v1 | |
with: | |
version: pnpm changeset:version | |
publish: pnpm changeset:publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- id: build_docs | |
name: Build docs | |
if: steps.changesets.outputs.published == 'true' | |
run: pnpm build:docs | |
- id: commit_and_push | |
name: Commit and push changes | |
if: steps.changesets.outputs.published == 'true' | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "docs" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |