Skip to content

feat(global): [DSM-775] storybook v7 upgrade (#782) #365

feat(global): [DSM-775] storybook v7 upgrade (#782)

feat(global): [DSM-775] storybook v7 upgrade (#782) #365

Workflow file for this run

name: Bit Deploy
on:
push:
branches: [main]
jobs:
deploy:
name: 'Deploy Bit Packages'
runs-on: ubuntu-latest
env:
BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
BIT_VERSION: ${{ secrets.BIT_VERSION }}
steps:
- id: token
name: Token
uses: getsentry/action-github-app-token@v1
with:
app_id: ${{ secrets.CX_RELEASE_APP_ID }}
private_key: '${{ secrets.CX_RELEASE_APP_PRIVATE_KEY }}'
- uses: actions/checkout@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
token: ${{ steps.token.outputs.token }}
- uses: actions/setup-node@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
node-version: '16'
- name: Install Bit CLI
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
npm i -g @teambit/bvm
bvm install ${BIT_VERSION}
env:
BIT_VERSION: ${{ secrets.BIT_VERSION }}
- name: Add bvm bin folder to path
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
echo "$HOME/bin" >> $GITHUB_PATH
echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV
- name: Set up bit config
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
echo "Adding bit.dev to npm registry"
export PATH=${{ env.PATH }}
npm config set @bit:registry https://node.bit.dev
npm config set @carlsberggroup:registry=https://node.bit.dev
npm config set @teambit:registry=https://node.bit.dev
bit config set analytics_reporting false
bit config set anonymous_reporting false
bit config set user.token ${BIT_TOKEN}
echo "Completed adding bit.dev to npm registry"
env:
BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
- name: Bit Deps Install & Compile
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
export PATH=${{ env.PATH }}
yarn cache clean --force
bit clear-cache
bit install
bit compile
shell: bash
- name: Bit Tag Components
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
export PATH=${{ env.PATH }}
bit tag
shell: bash
- name: Format workspace.jsonc
run: |
yarn prettier --write workspace.jsonc
shell: bash
- name: Export components
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
export PATH=${{ env.PATH }}
bit export
shell: bash
- name: Configure Git
run: |
git config --global user.name "${CX_RELEASE_APP_USER_NAME}"
git config --global user.email "${CX_RELEASE_APP_USER_EMAIL}"
shell: bash
env:
CX_RELEASE_APP_USER_NAME: ${{ secrets.CX_RELEASE_APP_USER_NAME }}
CX_RELEASE_APP_USER_EMAIL: ${{ secrets.CX_RELEASE_APP_USER_EMAIL }}
- name: Create Pull Request
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git add .
git commit -m "release: Bit GitHub Action (automated) [skip ci]"
git push
shell: bash
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
- name: Trigger MTA Build and Deploy
run: |
curl -X POST -d {} "https://webhooks.amplify.eu-west-1.amazonaws.com/prod/webhooks?id=${AMPLIFY_WEBHOOK_KEY}&operation=startbuild" -H "Content-Type:application/json"
shell: bash
env:
AMPLIFY_WEBHOOK_KEY: ${{ secrets.AMPLIFY_WEBHOOK_KEY }}