feat: show links on docs & learn page #82
This file contains hidden or 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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
locales: | |
description: 'Comma-separated list of locales to deploy (e.g., en,zh-hans). Leave empty to deploy all enabled locales.' | |
required: false | |
type: string | |
push: | |
branches: | |
- main | |
jobs: | |
check-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix-include: ${{ steps.check-locales.outputs.matrix-include }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: ${{ github.event_name == 'push' && 0 || 1 }} | |
- name: Check locale changes | |
id: check-locales | |
uses: ./.github/actions/check-locale-changes | |
with: | |
trigger-type: ${{ github.event_name == 'workflow_dispatch' && 'manual' || 'auto' }} | |
manual-locales: ${{ github.event.inputs.locales }} | |
deploy-and-update-index: | |
needs: check-changes | |
if: needs.check-changes.outputs.matrix-include != '[]' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: ${{ fromJson(needs.check-changes.outputs.matrix-include) }} | |
name: Deploy ${{ matrix.locale }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Setup Tools | |
uses: ./.github/actions/setup | |
- name: Deploy to Vercel (${{ matrix.locale }}) | |
id: deploy | |
uses: ./.github/actions/vercel-deploy | |
with: | |
environment: production | |
prodFlag: --prod | |
vercel_project_id: ${{ secrets[matrix.secret_project_id] }} | |
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }} | |
vercel_token: ${{ secrets.VERCEL_TOKEN }} | |
- name: Copy .vercel/.env.production.local | |
shell: bash | |
run: | | |
cp .vercel/.env.production.local apps/docs/.env | |
- name: Update Search Index | |
shell: bash | |
run: pnpm run docs:update-search-index |