-
Notifications
You must be signed in to change notification settings - Fork 34
59 lines (52 loc) · 2.05 KB
/
deploy-with-java.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
name: pyvespa - Build and Deploy with Java - Github Action
on:
workflow_dispatch:
push:
branches:
- thomasht86/tests-to-github-action
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Vespa uses Java 17
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
# Find Vespa version of current production deployment
- name: Find compile version
env:
VESPA_TEAM_API_KEY: ${{ secrets.VESPA_TEAM_API_KEY }}
working-directory: tests/testapps/production-deployment-with-tests-java
run: mvn -B clean vespa:compileVersion -DapiKey="${VESPA_TEAM_API_KEY}"
# Build the application package and the tester bundle
- name: Build with Maven
working-directory: tests/testapps/production-deployment-with-tests-java
run: mvn -B package -Dvespa.compile.version="$(cat target/vespa.compile.version)"
# Upload artifacts to be used in the deploy job
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: target/*
name: applicationpackage
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip" # caching pip dependencies
- name: Install dependencies
run: pip install pyvespa vespacli
- name: Deploy to prod
env:
VESPA_TEAM_API_KEY: ${{ secrets.VESPA_TEAM_API_KEY }}
run: |
python .github/workflows/deploy_to_prod.py \
--tenant vespa-team \
--application testapp \
--api-key $VESPA_TEAM_API_KEY \
--application-root tests/testapps/production-deployment-with-tests-java/target/ \
--max-wait 3600 \
--source-url "$(git config --get remote.origin.url | sed 's+git@\(.*\):\(.*\)\.git+https://\1/\2+')/commit/$(git rev-parse HEAD)"