Skip to content

Commit 2a80a6a

Browse files
committed
ci: add reusable action for deploy components
Signed-off-by: Árpád Csepi <[email protected]>
1 parent fb62102 commit 2a80a6a

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
name: Deploy agntcy components
6+
description: Deploy agntcy components for integration testing
7+
inputs:
8+
deploy-gateway:
9+
description: 'Deploy gateway to a kind cluster'
10+
required: false
11+
default: 'false'
12+
gateway-image-version:
13+
description: 'Set gateway container image version'
14+
required: false
15+
default: ''
16+
deploy-directory:
17+
description: 'Deploy directory to a kind cluster'
18+
required: false
19+
default: 'false'
20+
directory-image-version:
21+
description: 'Set directory container image version'
22+
required: false
23+
default: ''
24+
kind-cluster-name:
25+
description: 'Set kind cluster name where components are deployed'
26+
required: false
27+
default: 'agntcy-components'
28+
kind-cluster-namespace:
29+
description: 'Set cluster namespace where components are deployed'
30+
required: false
31+
default: 'default'
32+
github-repository-ref:
33+
description: 'Set a ref for git checkout'
34+
required: false
35+
default: 'main'
36+
install-kind-dependency:
37+
description: 'KinD installer'
38+
required: false
39+
default: 'false'
40+
kind-binary-version:
41+
description: 'Installed KinD version'
42+
required: false
43+
default: 'v0.27.0'
44+
install-taskfile-dependency:
45+
description: 'Taskfile installer'
46+
required: false
47+
default: 'false'
48+
49+
runs:
50+
using: composite
51+
steps:
52+
- name: Checkout agntcy repository
53+
uses: actions/checkout@v4
54+
with:
55+
repository: 'agntcy/csit'
56+
ref: ${{ inputs.github-repository-ref }}
57+
path: 'agntcy-csit'
58+
59+
- name: Install KinD
60+
if: ${{ inputs.install-kind-depedency != 'false' }}
61+
shell: bash
62+
run: |
63+
ARCH=""
64+
if [ $(uname -m) = x86_64 ]; then
65+
ARCH="amd64"
66+
elif [ $(uname -m) = aarch64 ]; then
67+
ARCH="arm64"
68+
else
69+
echo "Unkown architecture, abort!"
70+
exit 1
71+
fi
72+
73+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/${{ inputs.kind-binary-version }}/kind-linux-$ARCH
74+
75+
chmod +x ./kind
76+
sudo mv ./kind /usr/local/bin/kind
77+
78+
- name: Install Taskfile
79+
if: ${{ inputs.install-taskfile-depedency != 'false' }}
80+
uses: arduino/setup-task@v2
81+
with:
82+
version: 3.x
83+
84+
# Maybe /usr/local/bin is already in PATH by default
85+
# - name: Update GITHUB_PATH
86+
# shell: bash
87+
# run: echo "/usr/local/bin" >> $GITHUB_PATH
88+
89+
- name: Create kind cluster
90+
shell: bash
91+
run: |
92+
task -d agntcy-csit/ integrations:kind:create \
93+
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }}
94+
95+
- name: Deploy Gateway
96+
if: ${{ inputs.deploy-gateway != 'false' }}
97+
shell: bash
98+
run: |
99+
task -d agntcy-csit/ integrations:gateway:test-env:deploy \
100+
GATEWAY_IMAGE_TAG=${{ inputs.gateway-image-version }} \
101+
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \
102+
HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }}
103+
104+
- name: Deploy Directory
105+
if: ${{ inputs.deploy-directory != 'false' }}
106+
shell: bash
107+
run: |
108+
task -d agntcy-csit/ integrations:directory:test-env:deploy \
109+
DIRECTORY_IMAGE_TAG=${{ inputs.directory-image-version }} \
110+
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \
111+
HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }}

0 commit comments

Comments
 (0)