Skip to content

Commit

Permalink
Added conditional to wf
Browse files Browse the repository at this point in the history
  • Loading branch information
TryCatchLearn committed Aug 21, 2024
1 parent 3092a47 commit c4b56c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
build-and-push:
runs-on: ubuntu-latest
env:
continue: 'false'

strategy:
matrix:
service:
Expand All @@ -30,16 +33,29 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Check for changes in service path
run: |
if git diff --quiet HEAD^ HEAD -- ${{matrix.service.path}}; then
echo "No changes in ${{matrix.service.path}}. Skipping build"
echo "continue=false" >> $GITHUB_ENV
else
echo "Changes detected in ${{matrix.service.path}}. Proceeding with build"
echo "continue=true" >> $GITHUB_ENV
fi
- name: Set up Docker buildx
if: env.continue == 'true'
uses: docker/setup-buildx-action@v2

- name: Login to Docker
if: env.continue == 'true'
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_TOKEN}}

- name: Build and push docker image
if: env.continue == 'true'
uses: docker/build-push-action@v6
with:
context: .
Expand Down
2 changes: 1 addition & 1 deletion src/GatewayService/appsettings.Docker.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Information"
"Microsoft.AspNetCore": "Warning"
}
},
"IdentityServiceUrl": "http://identity-svc",
Expand Down

0 comments on commit c4b56c9

Please sign in to comment.