Compare commits
10 Commits
30dc1138e7
...
a53421d693
Author | SHA1 | Date | |
---|---|---|---|
a53421d693 | |||
24b2540197 | |||
b9e70bc413 | |||
573d2f3fbc | |||
1eed31c115 | |||
13af897f68 | |||
2f52a626af | |||
a794362adf | |||
265abb71c7 | |||
9d98c627e5 |
@ -10,7 +10,7 @@ on:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-deploy(production):
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
@ -6,7 +6,38 @@ on:
|
||||
types: [opened,synchronize]
|
||||
|
||||
jobs:
|
||||
build-and-deploy(dev):
|
||||
check-file-changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should_run: ${{ steps.filter.outputs.should_run }}
|
||||
steps:
|
||||
- name: 🚚 Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 📑 Check changed files
|
||||
id: filter
|
||||
run: |
|
||||
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} || git diff --name-only HEAD~1 HEAD)
|
||||
|
||||
IMPORTANT_FILE_CHANGED=false
|
||||
for file in $CHANGED_FILES; do
|
||||
if [[ $file =~ \.(ts|yaml|json|js|scss)$ ]]; then
|
||||
IMPORTANT_FILE_CHANGED=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$IMPORTANT_FILE_CHANGED" = true ]; then
|
||||
echo "should_run=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_run=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
build-and-deploy:
|
||||
needs: check-file-changes
|
||||
if: ${{ needs.check-file-changes.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
Loading…
x
Reference in New Issue
Block a user