Skip to content
# 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.9"
cache: "pip" # caching pip dependencies
- name: Install dependencies
run: pip install pyvespa vespacli python-dateutil
- 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)"