chore(changesets): 🦋📦 publish packages (main) (#3298) #157
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
### | |
# | |
# DEPRECATED: This Action can be removed as soon as we start working on V2/V9 | |
# | |
### | |
name: Release Demo App to Netlify | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'packages/demo/package.json' | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release demo | |
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/demo/package.json | |
diff-search: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup | |
if: steps.check.outputs.changed == 'true' | |
uses: ./.github/actions/setup-pnpm | |
# Install changesets locally | |
- name: Install demo app & dependencies | |
if: steps.check.outputs.changed == 'true' | |
run: pnpm --filter "design-system-demo..." install | |
# Build the demo app and it's dependencies | |
- name: Build demo app & dependencies | |
if: steps.check.outputs.changed == 'true' | |
run: pnpm --filter "design-system-demo..." build | |
- name: Install netlify cli | |
if: steps.check.outputs.changed == 'true' | |
run: pnpm -g i netlify-cli@16 | |
# Publish demo only if changesets published any packages | |
- name: Publish demo app to netlify | |
id: netlify | |
if: steps.check.outputs.changed == 'true' | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
run: netlify deploy --filter @swisspost/design-system-demo --build false --dir packages/demo/dist/demo --prod |