chore(fuselage): Split TopBar
components (#1304)
#932
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: Continuous Delivery | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
build-and-test: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
outputs: | |
branch-name: ${{ steps.set-branch-name.outputs.branch-name }} | |
steps: | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "14.21.3" | |
- uses: actions/checkout@v2 | |
- name: Turbo Cache | |
id: turbo-cache | |
uses: actions/cache@v2 | |
with: | |
path: .turbo | |
key: turbo-${{ runner.os }}-${{ github.job }} | |
restore-keys: | | |
turbo-${{ runner.os }}- | |
- uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: | | |
**/node_modules | |
.yarn/cache | |
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} | |
- run: yarn install | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
- run: yarn run ci | |
- run: yarn run docs | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: storybooks | |
path: | | |
packages/fuselage/storybook-static | |
packages/onboarding-ui/storybook-static | |
packages/layout/storybook-static | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: docs | |
path: | | |
static | |
- run: | | |
ref='${{ github.ref }}' | |
echo "::set-output name=branch-name::$(echo "${ref:11}")" | |
id: set-branch-name | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: build | |
path: packages/**/dist/* | |
publish-to-npm: | |
name: Publish to NPM | |
runs-on: ubuntu-latest | |
needs: | |
- build-and-test | |
steps: | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "14.21.3" | |
registry-url: "https://registry.npmjs.org" | |
scope: "@rocket.chat" | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: | | |
**/node_modules | |
.yarn/cache | |
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} | |
- uses: actions/download-artifact@v2 | |
with: | |
name: build | |
path: packages | |
- run: yarn install | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
- name: Create Release Pull Request | |
id: changesets | |
uses: changesets/action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Resolve workspace dependencies | |
if: steps.changesets.outputs.hasChangesets == 'false' | |
run: yarn resolve-workspace-deps | |
- name: Publish to npm | |
if: steps.changesets.outputs.hasChangesets == 'false' | |
uses: changesets/action@v1 | |
with: | |
publish: yarn release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-to-gh-pages: | |
name: Publish to GitHub Pages | |
runs-on: ubuntu-latest | |
needs: | |
- build-and-test | |
environment: | |
name: github-pages | |
url: "https://rocketchat.github.io/Rocket.Chat.Fuselage/fuselage/${{ needs.build-and-test.outputs.branch-name }}" | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
- uses: actions/download-artifact@v2 | |
with: | |
name: storybooks | |
path: packages | |
- uses: actions/download-artifact@v2 | |
with: | |
name: docs | |
path: . | |
- run: | | |
rm -rf "fuselage/${{ needs.build-and-test.outputs.branch-name }}" "layout/${{ needs.build-and-test.outputs.branch-name }}" "onboarding-ui/${{ needs.build-and-test.outputs.branch-name }}" | |
mv -v "packages/fuselage/storybook-static" "fuselage/${{ needs.build-and-test.outputs.branch-name }}" | |
mv -v "packages/onboarding-ui/storybook-static" "onboarding-ui/${{ needs.build-and-test.outputs.branch-name }}" | |
mv -v "packages/layout/storybook-static" "layout/${{ needs.build-and-test.outputs.branch-name }}" | |
rm -rf packages | |
- uses: crazy-max/ghaction-github-pages@v2 | |
with: | |
target_branch: gh-pages | |
build_dir: . | |
commit_message: "Deploy to Github Pages [skip ci]" | |
jekyll: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |