Skip to content

Commit

Permalink
chore(workflows): add summary to release-documentation.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschuerch committed Jul 8, 2024
1 parent ef489b5 commit 0d16685
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/release-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ on:
- main
paths:
- 'packages/documentation/package.json'
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
check-version:
name: Check Version
detect-version-change:
name: Detect Version Change
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.check.outputs.changed }}
Expand All @@ -33,11 +34,23 @@ jobs:
diff-search: true
token: ${{ secrets.GITHUB_TOKEN }}

- name: Create Summary
id: summary
uses: actions/github-script@v7
with:
script: |
return `# Version changed
A version change has ${${{ steps.check.outputs.changed == 'true' }} ? 'been' : 'NOT been'} detected.
`
- name: Output Summary
run: echo -e ${{ steps.summary.outputs.result }} >> $GITHUB_STEP_SUMMARY

release:
name: Release Documentation
runs-on: ubuntu-latest
needs: check-version
if: needs.check-version.outputs.changed == 'true'
needs: detect-version-change
if: needs.detect-version-change.outputs.changed == 'true'
steps:
- name: Setup
uses: ./.github/actions/setup-pnpm
Expand All @@ -64,3 +77,15 @@ jobs:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ fromJSON(steps.netlify-config.outputs.result).siteId }}
run: netlify deploy --filter @swisspost/design-system-documentation --build false --dir packages/documentation/storybook-static --prod

- name: Create Summary
id: summary
uses: actions/github-script@v7
with:
script: |
return `# Documentation released
The documentation has been released under: https://${{ fromJSON(steps.netlify-config.outputs.result).siteUrl }}.
`
- name: Output Summary
run: echo -e ${{ steps.summary.outputs.result }} >> $GITHUB_STEP_SUMMARY

0 comments on commit 0d16685

Please sign in to comment.