workflow and ssBtn updated #55
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: path | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
ssBtn: ${{ steps.filter.outputs.ssBtn }} | |
ssHeader: ${{ steps.filter.outputs.ssHeader }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Check for changes | |
uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
ssBtn: | |
- 'package/ss-button/**' | |
ssHeader: | |
- 'package/ss-header/**' | |
ssBtn: | |
needs: changes | |
if: ${{ needs.changes.outputs.ssBtn == 'true' }} | |
name: create build | |
uses: ./.github/workflows/build.yml | |
with: | |
working-directory: package/ss-button | |
ssBtnPublish: | |
needs: [ssHeader, ssBtn] | |
if: ${{ always() && needs.ssBtn.result == 'success' && (needs.ssHeader.result == 'success' || needs.ssHeader.result == 'skipped') }} | |
name: publish package | |
uses: ./.github/workflows/publish-package.yml | |
with: | |
working-directory: package/ss-button | |
secrets: | |
MY_SECRET: ${{ secrets.NPM_PUBLISH_WORKFLOW }} | |
ssHeader: | |
needs: changes | |
if: ${{ needs.changes.outputs.ssHeader == 'true' }} | |
name: create build | |
uses: ./.github/workflows/build.yml | |
with: | |
working-directory: package/ss-header | |
ssHeaderPublish: | |
needs: [ssHeader, ssBtn] | |
if: ${{ always() && needs.ssHeader.result == 'success' && (needs.ssBtn.result == 'success' || needs.ssBtn.result == 'skipped') }} | |
name: publish package | |
uses: ./.github/workflows/publish-package.yml | |
with: | |
working-directory: package/ss-header | |
secrets: | |
MY_SECRET: ${{ secrets.NPM_PUBLISH_WORKFLOW }} | |
publish-storybook: | |
runs-on: ubuntu-latest | |
needs: [ssHeaderPublish, ssBtnPublish] | |
if: ${{ always() &&( (needs.ssHeaderPublish.result == 'success' && (needs.ssBtnPublish.result == 'success' || needs.ssBtnPublish.result == 'skipped')) || (needs.ssBtnPublish.result == 'success' && (needs.ssHeaderPublish.result == 'success' || needs.ssHeaderPublish.result == 'skipped')) )}} | |
defaults: | |
run: | |
working-directory: storybook | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 # Adjust to your Node.js version | |
cache: "npm" | |
registry-url: https://registry.npmjs.org | |
- name: Install dependencies | |
run: npm install | |
- name: Build Storybook | |
run: npm run build-storybook | |
- name: List contents of Storybook build directory | |
run: ls -la ./storybook/storybook-static | |
- name: Ensure proper permissions | |
run: chmod -R 755 ./storybook/storybook-static | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: storybook-static |