Skip to content

Commit 0275910

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

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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+
echo
40+
cat console-sample-apps.json
41+
echo
42+
echo "${delimiter}"
43+
} >> "$GITHUB_OUTPUT"
44+
45+
deploy-sample-apps:
46+
runs-on: ubuntu-latest
47+
48+
environment:
49+
name: Vespa Cloud
50+
url: https://cloud.vespa.ai
51+
52+
needs:
53+
- setup
54+
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
application: ${{ fromJSON(needs.setup.outputs.app-list-json) }}
59+
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: "App: ${{ matrix.application.name }}"
65+
run: |
66+
echo "Deploying application: ${{ matrix.application.name }}"
67+
echo "Application JSON: ${{ toJson(matrix.application) }}"
68+
69+
deploy-json:
70+
runs-on: ubuntu-latest
71+
72+
environment:
73+
name: Vespa Cloud
74+
url: https://cloud.vespa.ai
75+
76+
needs:
77+
- deploy-sample-apps
78+
79+
steps:
80+
- run: |
81+
echo "Noop, not deploying anything"

0 commit comments

Comments
 (0)