-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (78 loc) · 2.59 KB
/
Copy pathreleasse-index.yml
File metadata and controls
81 lines (78 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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 }}