Skip to content

Commit 0b916bf

Browse files
committed
Simplify secrets && scp
1 parent c8bc07b commit 0b916bf

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

.github/workflows/eric-continuous-integration.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ concurrency:
1616
jobs:
1717
build-all:
1818
name: Build all modules
19-
runs-on: ubuntu-latest
2019
if: ${{ github.repository_owner == 'spring-projects' }}
20+
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout source code
2323
uses: actions/checkout@v4
@@ -56,9 +56,9 @@ jobs:
5656
5757
test-ollama:
5858
name: Test Ollama
59+
if: ${{ github.repository_owner == 'spring-projects' }}
5960
runs-on: ubuntu-latest
6061
needs: build-all
61-
if: ${{ github.repository_owner == 'spring-projects' }}
6262
services:
6363
ollama:
6464
image: ollama/ollama:latest
@@ -110,9 +110,9 @@ jobs:
110110
111111
test-openai:
112112
name: Test OpenAI
113+
if: ${{ github.repository_owner == 'spring-projects' }}
113114
runs-on: ubuntu-latest
114115
needs: build-all
115-
if: ${{ github.repository_owner == 'spring-projects' }}
116116
steps:
117117
- name: Checkout source code
118118
uses: actions/checkout@v4
@@ -155,9 +155,9 @@ jobs:
155155
156156
test-remaining:
157157
name: Test Remaining (MCP, Google GenAI, Chroma, PgVector)
158+
if: ${{ github.repository_owner == 'spring-projects' }}
158159
runs-on: ubuntu-latest
159160
needs: build-all
160-
if: ${{ github.repository_owner == 'spring-projects' }}
161161
steps:
162162
- name: Checkout source code
163163
uses: actions/checkout@v4
@@ -200,9 +200,9 @@ jobs:
200200
201201
generate-javadocs:
202202
name: Generate and upload javadocs
203+
if: ${{ github.repository_owner == 'spring-projects' && github.event_name != 'schedule'}}
203204
runs-on: ubuntu-latest
204205
needs: [build-all, test-ollama, test-openai, test-remaining]
205-
if: ${{ github.repository_owner == 'spring-projects' && github.event_name != 'schedule'}}
206206
steps:
207207
- name: Checkout source code
208208
uses: actions/checkout@v4
@@ -229,31 +229,23 @@ jobs:
229229
run: echo PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
230230

231231
- name: Setup SSH key
232-
env:
233-
DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }}
234-
DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }}
235232
run: |
236233
mkdir "$HOME/.ssh"
237-
echo "$DOCS_SSH_KEY" > "$HOME/.ssh/key"
234+
echo "${{ secrets.DOCS_SSH_KEY }}" > "$HOME/.ssh/key"
238235
chmod 600 "$HOME/.ssh/key"
239-
echo "$DOCS_SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
236+
echo "${{ secrets.DOCS_SSH_HOST_KEY }}" > "$HOME/.ssh/known_hosts"
240237
241238
- name: Deploy docs
242-
env:
243-
DOCS_HOST: ${{ secrets.DOCS_HOST }}
244-
DOCS_PATH: ${{ secrets.DOCS_PATH }}
245-
DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }}
246-
working-directory: target/site/apidocs
247239
run: |
248-
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $PROJECT_VERSION"
249-
scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$PROJECT_VERSION
240+
ssh -i $HOME/.ssh/key ${{ secrets.DOCS_USERNAME }}@${{ secrets.DOCS_HOST }} "cd ${{ secrets.DOCS_PATH }} && mkdir -p $PROJECT_VERSION"
241+
scp -i $HOME/.ssh/key -r target/site/apidocs ${{ secrets.DOCS_USERNAME }}@${{ secrets.DOCS_HOST }}:${{ secrets.DOCS_PATH }}/$PROJECT_VERSION
250242
251243
252244
deploy-artifactory:
253245
name: Deploy to Artifactory
254246
runs-on: ubuntu-latest
255247
needs: [build-all, test-ollama, test-openai, test-remaining]
256-
if: ${{ github.repository_owner == 'spring-projects' && github.event_name != 'schedule' }}
248+
if: ${{ github.repository_owner == 'spring-projects' && github.event_name != 'schedule' }}
257249
steps:
258250
- name: Checkout source code
259251
uses: actions/checkout@v4

0 commit comments

Comments
 (0)