-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (41 loc) · 1.64 KB
/
deploy-vespa-cord-19-search.yaml
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
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# See https://cloud.vespa.ai/automated-deployments for details
# The ${VESPA_TEAM_VESPACLOUD_CORD_19_API_KEY} is a secret in this repository —
# this is used to deploy applications to Vespa Cloud
name: Deploy cord-19-search to Vespa Cloud
on:
push:
branches: [ main ]
env:
API_KEY: ${{ secrets.VESPA_TEAM_VESPACLOUD_CORD_19_API_KEY }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Check out the source code from the repository
- uses: actions/checkout@v3
# 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
working-directory: .
run: mvn -B clean vespa:compileVersion -DapiKey="${API_KEY}"
# Build the application package and the tester bundle
- name: Build with Maven
working-directory: .
run: mvn -B package -Dvespa.compile.version="$(cat target/vespa.compile.version)"
# Deploy to Vespa Cloud
- name: Deploy with Maven
working-directory: .
run: |
mvn -B vespa:submit \
-Drepository="$(git config --get remote.origin.url)" \
-Dbranch="$(git rev-parse --abbrev-ref HEAD)" \
-Dcommit="$(git rev-parse HEAD)" \
-DauthorEmail="$(git log -1 --format=%aE)" \
-DsourceUrl="$(git config --get remote.origin.url | sed 's+git@\(.*\):\(.*\)\.git+https://\1/\2+')/commit/$(git rev-parse HEAD)" \
-DapiKey="${API_KEY}"