Skip to content

docs: update nextjs documentation #4

docs: update nextjs documentation

docs: update nextjs documentation #4

name: Release Index
on:
workflow_call:
workflow_dispatch:
push:
branches:
- main
jobs:
check-changes:
runs-on: ubuntu-latest
if: github.event_name != 'workflow_dispatch'
outputs:
should_deploy: ${{ steps.set_output.outputs.should_deploy }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changes
uses: tj-actions/changed-files@v41
with:
files_yaml: |
app-index:
- 'apps/index/**'
- 'packages/**'
- name: Log changed-files outputs
shell: bash
run: |
echo "=== tj-actions/changed-files@v41 outputs ==="
echo '${{ toJSON(steps.changes.outputs) }}'
- name: Set deployment output
id: set_output
run: |
if [ "${{ steps.changes.outputs.app-index_any_changed }}" = "true" ]; then
echo "should_deploy=true" >> $GITHUB_OUTPUT
else
echo "should_deploy=false" >> $GITHUB_OUTPUT
fi
deploy-index:
runs-on: ubuntu-latest
name: Deploy Index
needs: [check-changes]
if: always() && (github.event_name == 'workflow_dispatch' || needs.check-changes.outputs.should_deploy == 'true')
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Log deployment reason
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "✅ Manual trigger - proceeding with deployment"
else
echo "✅ Changes detected in relevant files - proceeding with deployment"
fi
- uses: ./.github/actions/setup
- uses: ./.github/actions/vercel-pull
with:
environment: production
prodFlag: --prod
vercel_project_id: ${{ secrets.VERCEL_PROJECT_INDEX_ID }}
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }}
vercel_token: ${{ secrets.VERCEL_TOKEN }}
- uses: ./.github/actions/vercel-build
with:
environment: production
prodFlag: --prod
vercel_project_id: ${{ secrets.VERCEL_PROJECT_INDEX_ID }}
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }}
vercel_token: ${{ secrets.VERCEL_TOKEN }}
- uses: ./.github/actions/vercel-deploy
with:
environment: production
prodFlag: --prod
vercel_project_id: ${{ secrets.VERCEL_PROJECT_INDEX_ID }}
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }}
vercel_token: ${{ secrets.VERCEL_TOKEN }}