Compare commits
13 Commits
a53421d693
...
30dc1138e7
Author | SHA1 | Date | |
---|---|---|---|
30dc1138e7 | |||
c322465e0c | |||
b603a15033 | |||
de65cf5fa6 | |||
672a8946dc | |||
5b3674da24 | |||
524256187c | |||
2cac2cacf1 | |||
423b73abb3 | |||
8ed86c515f | |||
751b5a22b8 | |||
9e903e6948 | |||
0b18d83cd4 |
@ -10,7 +10,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy(production):
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -6,38 +6,7 @@ on:
|
|||||||
types: [opened,synchronize]
|
types: [opened,synchronize]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-file-changes:
|
build-and-deploy(dev):
|
||||||
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
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
Loading…
x
Reference in New Issue
Block a user