Skip to content

chore(changesets): 🦋📦 publish packages (#2124) #121

chore(changesets): 🦋📦 publish packages (#2124)

chore(changesets): 🦋📦 publish packages (#2124) #121

###
#
# Release the documentation whenever it's package json changes on the main branch
#
###
name: Release Documentation to Netlify
on:
push:
branches:
- main
paths:
- 'packages/documentation/package.json'
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check if version has changed
id: check # This will be the reference for getting the outputs.
uses: EndBug/version-check@v2 # You can choose the version/branch you prefer.
with:
file-name: ./packages/documentation/package.json
diff-search: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup
if: steps.check.outputs.changed == 'true'
uses: swisspost/design-system/.github/actions/setup-pnpm@main
- name: Install documentation & dependencies
if: steps.check.outputs.changed == 'true'
run: pnpm --filter "design-system-documentation..." install
- name: Build documentation & dependencies
if: steps.check.outputs.changed == 'true'
run: pnpm --filter "design-system-documentation..." build
- name: Install netlify cli
if: steps.check.outputs.changed == 'true'
run: pnpm -g i netlify-cli@15
- name: Publish documentation to netlify
if: steps.check.outputs.changed == 'true'
env:
NETLIFY_SITE_ID: ${{ secrets.NEXT_NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
netlify link --id $NETLIFY_SITE_ID
netlify deploy --build false --dir packages/documentation/storybook-static --prod