feat: Link bus tooltip to line profile #336
Workflow file for this run
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: Preview | |
on: | |
pull_request: | |
env: | |
ASSET_URL: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }} | |
should_run: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
jobs: | |
should_run: | |
runs-on: ubuntu-latest | |
outputs: | |
should_run: ${{ steps.set_should_run.outputs.should_run }} | |
steps: | |
- name: Set should_run | |
id: set_should_run | |
if: env.should_run | |
run: echo "::set-output name=should_run::true" | |
build: | |
runs-on: ubuntu-latest | |
needs: [should_run] | |
if: ${{ needs.should_run.outputs.should_run == 'true' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Run install | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
build-storybook: | |
runs-on: ubuntu-latest | |
needs: [should_run] | |
if: ${{ needs.should_run.outputs.should_run == 'true' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Run install | |
run: npm ci | |
- name: Build Storybook | |
run: npm run build-storybook -o dist/storybook | |
- name: upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
deploy-to-s3: | |
needs: [build, build-storybook] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
- uses: shallwefootball/s3-upload-action@master | |
name: Upload trace to S3 | |
if: always() | |
id: s3-trace | |
continue-on-error: true | |
with: | |
aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
aws_bucket: noam-gaash.co.il | |
source_dir: dist | |
destination_dir: ${{ github.run_id }}/open-bus/${{ github.sha }} | |
- name: find comment | |
uses: peter-evans/find-comment@v1 | |
if: github.event_name == 'pull_request' | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: 'Preview' | |
- name: update comment | |
uses: peter-evans/create-or-update-comment@v1 | |
if: steps.fc.outputs.comment-id | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
edit-mode: replace | |
body: | | |
Preview: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/index.html | |
Preview Storybook: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/storybook/index.html | |
- name: create comment | |
uses: peter-evans/create-or-update-comment@v1 | |
if: steps.fc.outputs.comment-id == '' | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
Preview: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/index.html | |
Preview Storybook: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/storybook/index.html |