Skip to content

Prerelease

Prerelease #2

Workflow file for this run

name: Prerelease
on:
workflow_dispatch:
jobs:
localization:
uses: ./.github/workflows/crowdin.yml
secrets:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
PAT: ${{ secrets.PAT }}
deploy:
runs-on: ubuntu-latest
needs:
- localization
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- name: Checkout latest changes from 'next' branch with Crowdin updates
run: |
git fetch origin next
git checkout next
git pull origin next
- name: Prepare
uses: ./.github/actions/prepare
- name: Deploy packages
id: deploy-packages
run: |
yarn global add vercel
yarn run deploy
env:
REF: ${{ github.ref }}
GH_TOKEN: ${{ github.token }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_WIDGET_CONFIG: ${{ secrets.VERCEL_PROJECT_WIDGET_CONFIG }} # widget playground
VERCEL_PROJECT_WIDGET_APP: ${{ secrets.VERCEL_PROJECT_WIDGET_APP }} # widget app
VERCEL_PROJECT_STORYBOOK: ${{ secrets.VERCEL_PROJECT_STORYBOOK }} # storybook
ENABLE_PREVIEW_DEPLOY: true
outputs:
# the structure of output variable is {packageNameWithoutScope}-url like: widget-app-url
app_url: ${{ steps.deploy-packages.outputs.widget-app-url }}
playground_url: ${{ steps.deploy-packages.outputs.widget-playground-url }}
storybook_url: ${{ steps.deploy-packages.outputs.storybook-url }}
# add job for each project that you want has preview deployment
app-preview:
runs-on: ubuntu-latest
needs: deploy
environment:
name: app-preview
url: ${{ steps.seturl.outputs.url }}
steps:
- name: Extract Preview URL
id: seturl
run: |
echo "url=${{ needs.deploy.outputs.app_url }}">> $GITHUB_OUTPUT
echo "Preview URL: ${{ needs.deploy.outputs.app_url}}"
playground-preview:
runs-on: ubuntu-latest
needs: deploy
environment:
name: playground-preview
url: ${{ steps.seturl.outputs.url }}
steps:
- name: Extract Preview URL
id: seturl
run: |
echo "url=${{ needs.deploy.outputs.playground_url }}">> $GITHUB_OUTPUT
echo "Preview URL: ${{ needs.deploy.outputs.playground_url}}"
storybook-preview:
runs-on: ubuntu-latest
needs: deploy
environment:
name: storybook-preview
url: ${{ steps.seturl.outputs.url }}
steps:
- name: Extract Preview URL
id: seturl
run: |
echo "url=${{ needs.deploy.outputs.storybook_url }}">> $GITHUB_OUTPUT
echo "Preview URL: ${{ needs.deploy.outputs.storybook_url}}"