-
Notifications
You must be signed in to change notification settings - Fork 60
43 lines (39 loc) · 1.15 KB
/
deploy-app.yml
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
name: Deploy Apps
on:
workflow_call:
inputs:
app-name:
required: true
type: string
jobs:
check_changes:
runs-on: ubuntu-latest
outputs:
changes_detected: ${{ steps.check_changes.outputs.changes_detected }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check for relevant changes
id: check_changes
run: |
changes=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
echo "Changes detected:"
echo "$changes"
if echo "$changes" | grep -qE "^(apps/infra/|apps/${{ inputs.app-name }}/|packages/)"
then
echo "changes_detected=true" >> $GITHUB_OUTPUT
else
echo "changes_detected=false" >> $GITHUB_OUTPUT
fi
deploy:
needs: check_changes
if: needs.check_changes.outputs.changes_detected == 'true'
uses: ./.github/workflows/deploy-common.yml
with:
working-directory: apps/infra
stack-name: app-production-${{ inputs.app-name }}
secrets: inherit
concurrency:
group: production-${{ inputs.app-name }}
cancel-in-progress: false