@@ -46,63 +46,63 @@ jobs:
4646 - name : Checkout source code
4747 uses : actions/checkout@v4
4848
49- - name : Check for new commits since last build
50- id : changes
51- run : |
52- # Get the timestamp of the latest commit on this branch
53- LATEST_COMMIT_TIME=$(git log -1 --format="%ct" HEAD)
54- echo "Latest commit timestamp: $LATEST_COMMIT_TIME ($(date -d @$LATEST_COMMIT_TIME))"
55-
56- # Get the last successful build time using GitHub API
57- # Look for the most recent successful CI build on this branch
58- LAST_SUCCESS=$(curl -s \
59- -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
60- -H "Accept: application/vnd.github.v3+json" \
61- "https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=${{ github.ref_name }}&status=success&per_page=50" \
62- | jq -r '.workflow_runs[] | select(.name == "CI/CD build" and .conclusion == "success") | .created_at' \
63- | head -1)
64-
65- if [ -n "$LAST_SUCCESS" ] && [ "$LAST_SUCCESS" != "null" ]; then
66- LAST_SUCCESS_TIME=$(date -d "$LAST_SUCCESS" +%s)
67- echo "Last successful build: $LAST_SUCCESS_TIME ($(date -d @$LAST_SUCCESS_TIME))"
68-
69- if [ "$LATEST_COMMIT_TIME" -le "$LAST_SUCCESS_TIME" ]; then
70- echo "No new commits since last successful build - skipping"
71- echo "skip_build=true" >> $GITHUB_OUTPUT
72- exit 0
73- else
74- echo "New commits found since last successful build - proceeding"
75- echo "skip_build=false" >> $GITHUB_OUTPUT
76- fi
77- else
78- echo "No previous successful build found - proceeding with build"
79- echo "skip_build=false" >> $GITHUB_OUTPUT
80- fi
49+ # - name: Check for new commits since last build
50+ # id: changes
51+ # run: |
52+ # # Get the timestamp of the latest commit on this branch
53+ # LATEST_COMMIT_TIME=$(git log -1 --format="%ct" HEAD)
54+ # echo "Latest commit timestamp: $LATEST_COMMIT_TIME ($(date -d @$LATEST_COMMIT_TIME))"
55+ #
56+ # # Get the last successful build time using GitHub API
57+ # # Look for the most recent successful CI build on this branch
58+ # LAST_SUCCESS=$(curl -s \
59+ # -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
60+ # -H "Accept: application/vnd.github.v3+json" \
61+ # "https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=${{ github.ref_name }}&status=success&per_page=50" \
62+ # | jq -r '.workflow_runs[] | select(.name == "CI/CD build" and .conclusion == "success") | .created_at' \
63+ # | head -1)
64+ #
65+ # if [ -n "$LAST_SUCCESS" ] && [ "$LAST_SUCCESS" != "null" ]; then
66+ # LAST_SUCCESS_TIME=$(date -d "$LAST_SUCCESS" +%s)
67+ # echo "Last successful build: $LAST_SUCCESS_TIME ($(date -d @$LAST_SUCCESS_TIME))"
68+ #
69+ # if [ "$LATEST_COMMIT_TIME" -le "$LAST_SUCCESS_TIME" ]; then
70+ # echo "No new commits since last successful build - skipping"
71+ # echo "skip_build=true" >> $GITHUB_OUTPUT
72+ # exit 0
73+ # else
74+ # echo "New commits found since last successful build - proceeding"
75+ # echo "skip_build=false" >> $GITHUB_OUTPUT
76+ # fi
77+ # else
78+ # echo "No previous successful build found - proceeding with build"
79+ # echo "skip_build=false" >> $GITHUB_OUTPUT
80+ # fi
8181
82- - name : Build skipped - no new commits
83- if : steps.changes.outputs.skip_build == 'true'
84- run : |
85- echo "✅ CI/CD build skipped - no new commits since last successful build"
86- echo "This saves resources and reduces unnecessary builds"
87- echo "The next scheduled build will check again for new commits"
82+ # - name: Build skipped - no new commits
83+ # if: steps.changes.outputs.skip_build == 'true'
84+ # run: |
85+ # echo "✅ CI/CD build skipped - no new commits since last successful build"
86+ # echo "This saves resources and reduces unnecessary builds"
87+ # echo "The next scheduled build will check again for new commits"
8888
8989 - name : Free Disk Space
90- if : steps.changes.outputs.skip_build != 'true'
90+ # if: steps.changes.outputs.skip_build != 'true'
9191 uses : jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
9292 with :
9393 large-packages : false
9494 docker-images : false
9595
9696 - name : Set up JDK 17
97- if : steps.changes.outputs.skip_build != 'true'
97+ # if: steps.changes.outputs.skip_build != 'true'
9898 uses : actions/setup-java@v4
9999 with :
100100 java-version : ' 17'
101101 distribution : ' temurin'
102102 cache : ' maven'
103103
104104 - name : Configure Testcontainers
105- if : steps.changes.outputs.skip_build != 'true'
105+ # if: steps.changes.outputs.skip_build != 'true'
106106 run : |
107107 echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties
108108
@@ -112,7 +112,7 @@ jobs:
112112 # key: docker-${{ runner.os }}-${{ hashFiles('**/OllamaImage.java') }}
113113
114114 - name : Build and test with Maven
115- if : steps.changes.outputs.skip_build != 'true'
115+ # if: steps.changes.outputs.skip_build != 'true'
116116 env :
117117 OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
118118 SPRING_AI_OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
@@ -132,20 +132,24 @@ jobs:
132132 fi
133133
134134 - name : Generate Java docs
135- if : github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
135+ if : github.ref == 'refs/heads/main'
136+ # if: github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
136137 run : ./mvnw --batch-mode javadoc:aggregate
137138
138139 - name : Generate assembly
139- if : github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
140+ if : github.ref == 'refs/heads/main'
141+ # if: github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
140142 working-directory : spring-ai-docs
141143 run : ../mvnw --batch-mode assembly:single
142144
143145 - name : Capture project version
144- if : github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
146+ if : github.ref == 'refs/heads/main'
147+ # if: github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
145148 run : echo PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
146149
147150 - name : Setup SSH key
148- if : github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
151+ if : github.ref == 'refs/heads/main'
152+ # if: github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
149153 env :
150154 DOCS_SSH_KEY : ${{ secrets.DOCS_SSH_KEY }}
151155 DOCS_SSH_HOST_KEY : ${{ secrets.DOCS_SSH_HOST_KEY }}
@@ -156,7 +160,8 @@ jobs:
156160 echo "$DOCS_SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
157161
158162 - name : Deploy docs
159- if : github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
163+ if : github.ref == 'refs/heads/main'
164+ # if: github.ref == 'refs/heads/main' && steps.changes.outputs.skip_build != 'true'
160165 env :
161166 DOCS_HOST : ${{ secrets.DOCS_HOST }}
162167 DOCS_PATH : ${{ secrets.DOCS_PATH }}
0 commit comments