[Loom-1535] - add form-test to bpkSlider (#3579) #593
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: Main | |
on: | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
CACHE_NAME: node-modules-cache | |
BUILD_CACHE_NAME: build-cache | |
jobs: | |
Create-NPM-Cache: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
registry-url: 'https://registry.npmjs.org' | |
- name: Upload to Cache | |
uses: actions/cache@v4.0.2 | |
id: npm-cache | |
with: | |
path: | | |
node_modules/ | |
packages/node_modules/ | |
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json', 'packages/package-lock.json') }} | |
- name: Install dependencies | |
if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }} | |
run: npm ci | |
Create-Build-Cache: | |
runs-on: ubuntu-latest | |
needs: [Create-NPM-Cache] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
registry-url: 'https://registry.npmjs.org' | |
- name: Restore NPM Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: npm-cache | |
with: | |
path: | | |
node_modules/ | |
packages/node_modules/ | |
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json', 'packages/package-lock.json') }} | |
- name: Upload dist-storybook to Cache | |
uses: actions/cache@v4.0.2 | |
id: storybook-dist-cache | |
with: | |
path: | | |
dist-storybook/ | |
key: ${{ env.BUILD_CACHE_NAME }}-${{ hashFiles('packages/**', 'examples/**') }} | |
- name: Create build cache | |
if: ${{ steps.storybook-dist-cache.outputs.cache-hit != 'true' }} | |
run: | | |
npm run build | |
npm run storybook:dist | |
Build: | |
permissions: | |
statuses: write | |
pull-requests: write | |
needs: [Create-NPM-Cache, Create-Build-Cache] | |
uses: ./.github/workflows/_build.yml | |
secrets: inherit | |
StorybookDeploy: | |
runs-on: ubuntu-latest | |
needs: [Create-NPM-Cache, Create-Build-Cache] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
registry-url: 'https://registry.npmjs.org' | |
- name: Restore npm Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: npm-cache | |
with: | |
path: | | |
node_modules/ | |
packages/node_modules/ | |
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json', 'packages/package-lock.json') }} | |
- name: Restore Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: storybook-dist-cache | |
with: | |
path: dist-storybook/ | |
key: ${{ env.BUILD_CACHE_NAME }}-${{ hashFiles('packages/**', 'examples/**') }} | |
- name: Deploy Storybook for main | |
uses: peaceiris/actions-gh-pages@v4 | |
if: github.ref == 'refs/heads/main' | |
with: | |
personal_token: ${{ secrets.DEPLOY_TOKEN }} | |
publish_dir: dist-storybook/ | |
keep_files: false | |
external_repository: backpack/storybook | |
publish_branch: main | |
SassDocDeploy: | |
runs-on: ubuntu-latest | |
needs: [Create-NPM-Cache, Create-Build-Cache] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
registry-url: 'https://registry.npmjs.org' | |
- name: Restore npm Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: npm-cache | |
with: | |
path: | | |
node_modules/ | |
packages/node_modules/ | |
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json', 'packages/package-lock.json') }} | |
- name: Build Sass docs | |
if: github.ref == 'refs/heads/main' | |
run: npm run sassdoc | |
- name: Deploy Sass docs to backpack.github.io, if on main branch | |
uses: peaceiris/actions-gh-pages@v4 | |
if: github.ref == 'refs/heads/main' | |
with: | |
personal_token: ${{ secrets.DEPLOY_TOKEN }} | |
publish_dir: dist-sassdoc/ | |
keep_files: false | |
external_repository: backpack/sassdoc | |
publish_branch: main | |
ReleaseDraft: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: read | |
steps: | |
- name: Draft release notes | |
uses: release-drafter/release-drafter@v6 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |