Skip to content

Commit 09ab4f2

Browse files
committed
feat: add deployment workflow to deploy sample apps to Vespa Cloud
1 parent 6060ca4 commit 09ab4f2

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
defaults:
12+
run:
13+
# Specify to ensure "pipefail and errexit" are set.
14+
# Ref: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#defaultsrunshell
15+
shell: bash
16+
17+
permissions:
18+
contents: read
19+
id-token: write # Required for OIDC authentication
20+
deployments: write
21+
22+
jobs:
23+
setup:
24+
runs-on: ubuntu-latest
25+
26+
outputs:
27+
app-list-json: ${{ steps.read-json.outputs.APP_LIST }}
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Read JSON
34+
id: read-json
35+
run: |
36+
delimiter="$(openssl rand -hex 8)"
37+
{
38+
echo "APP_LIST<<${delimiter}"
39+
sed -e '$a\' console-sample-apps.json # Ensures that an empty line is always present.
40+
echo "${delimiter}"
41+
} >> "$GITHUB_OUTPUT"
42+
43+
deploy-sample-apps:
44+
runs-on: ubuntu-latest
45+
46+
environment:
47+
name: Vespa Cloud
48+
url: https://cloud.vespa.ai
49+
50+
needs:
51+
- setup
52+
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
application: ${{ fromJSON(needs.setup.outputs.app-list-json) }}
57+
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
62+
- name: "App: ${{ matrix.application.name }}"
63+
run: |
64+
echo 'Deploying application: ${{ matrix.application.name }}'
65+
echo 'Application JSON: ${{ toJson(matrix.application) }}'
66+
67+
deploy-json:
68+
runs-on: ubuntu-latest
69+
70+
environment:
71+
name: Vespa Cloud
72+
url: https://cloud.vespa.ai
73+
74+
needs:
75+
- deploy-sample-apps
76+
77+
steps:
78+
- run: |
79+
echo "Noop, not deploying anything"

0 commit comments

Comments
 (0)