57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Detect Changes
|
|
description: Detect changed files and handle [deploy-all] commit override
|
|
|
|
outputs:
|
|
api:
|
|
description: Whether API changed
|
|
value: ${{ steps.override.outputs.api }}
|
|
dbmigrate:
|
|
description: Whether DBMigrate changed
|
|
value: ${{ steps.override.outputs.dbmigrate }}
|
|
website:
|
|
description: Whether WebSite changed
|
|
value: ${{ steps.override.outputs.website }}
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: generated-code
|
|
path: ${{ github.workspace }}
|
|
|
|
- id: filter
|
|
uses: dorny/paths-filter@v3
|
|
with:
|
|
filters: |
|
|
api:
|
|
- 'backends/express/**'
|
|
- 'sql/**'
|
|
- 'packages/**'
|
|
website:
|
|
- 'apps/website/**'
|
|
- 'packages/**'
|
|
|
|
- id: override
|
|
shell: bash
|
|
run: |
|
|
COMMIT_MESSAGE="${{ github.event.head_commit.message }}"
|
|
FORCE_PUSH="${{ github.event.forced }}"
|
|
|
|
echo "Commit message: $COMMIT_MESSAGE"
|
|
echo "Forced push: $FORCE_PUSH"
|
|
|
|
# Temporarily always return true for all services
|
|
echo "api=true" >> $GITHUB_OUTPUT
|
|
echo "website=true" >> $GITHUB_OUTPUT
|
|
|
|
# if [ "$FORCE_PUSH" = "true" ] || echo "$COMMIT_MESSAGE" | grep -q "\[deploy-all\]"; then
|
|
# echo "api=true" >> $GITHUB_OUTPUT
|
|
# echo "website=true" >> $GITHUB_OUTPUT
|
|
# else
|
|
# echo "api=${{ steps.filter.outputs.api }}" >> $GITHUB_OUTPUT
|
|
# echo "website=${{ steps.filter.outputs.website }}" >> $GITHUB_OUTPUT
|
|
# fi
|