-
Notifications
You must be signed in to change notification settings - Fork 14
57 lines (47 loc) · 1.73 KB
/
release-documentation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
###
#
# 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