-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 1.8 KB
/
manual-workflow.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Manual Flow Testing
on: workflow_dispatch
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
languages: ${{ steps.get-matrix.outputs.languages }}
env:
FUNC_VERSION: "knative-v1.16.1"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install func
uses: gauron99/knative-func-action@main
with:
version: ${{ env.FUNC_VERSION }}
name: f
- name: Get Matrix
id: get-matrix
run: |
WORKDIR=$(mktemp -d)
cd $WORKDIR
echo "did the cd work?"
pwd
## NOTE: ls -d returns absolute path
## GITHUB_WORKSPACE is the root directory
languages="{\"new\":["
languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')"
languages+="]}"
echo "TO MATRIX:$languages"
echo languages=languages >> $GITHUB_OUTPUT
deploy:
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
language: ${{ fromJSON(needs.prepare.outputs.languages) }}
env:
ACTIONS_STEP_DEBUG: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Functions
run: |
lang=$(basename "$lang_dir_abs")
echo "Building funcs in language $lang"
for template_dir_abs in $(ls -d $lang_dir_abs*/); do
echo "ls -la"
ls -la
echo "pwd"
pwd
echo "ls -la ${GITHUB_WORKSPACE}"
ls -la ${GITHUB_WORKSPACE}
template=$(basename "$template_dir_abs")
echo "f create $lang-$template -r=$url -l=$lang -t=$template"
f create $lang-$template -r "$url" -l "$lang" -t "$template"
#FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f done