-
Notifications
You must be signed in to change notification settings - Fork 21
81 lines (71 loc) · 2.58 KB
/
main.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Container Images
# todo - make this a creusable workflow, where caller call it with
# workflow_id and workflow_version where the reources path is ./$workflow_id
# from the context
on:
workflow_call:
inputs:
workflow_id:
required: true
type: string
workflow_version:
required: true
type: string
workflow_dispatch:
push:
branches: [ "main" ]
env:
workflow_id: mta
workflow_version: "0.0.1"
KN_VERSION: "v1.11.0"
KN_WORKFLOW_VERSION: "0.32.0"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Buildah Action
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: serverless-workflow-${{ env.workflow_id }}
tags: latest ${{ github.sha }}
extra-args: --ulimit nofile=4096:4096
containerfiles: |
pipeline/workflow-builder.Dockerfile
build-args: |
WF_RESOURCES=${{ env.workflow_id }}/
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/orchestrator
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
generate-manifests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: dir
run: cd ${{ env.workflow_id }} ; ls -la
- name: setup kn-workflow
run: curl -L https://github.com/rgolangh/kie-tools/releases/download/0.0.0-fix-kn-workflow/kn-workflow -o kn-workflow && chmod +x kn-workflow
- name: sanity
run: pwd; ls -la
- name: kn-workflow
run: cd ${{ env.workflow_id }} && ../kn-workflow gen-manifest
- name: Download yq
run: curl -L https://github.com/mikefarah/yq/releases/download/v4.35.2/yq_linux_x86_64 -o yq
- name: Remove dev profile
run: yq -i 'del(.metadata.annotations."sonataflow.org/profile")' ${{ env.workflow_id }}/manifests/01-sonataflow*.yaml
- name: Set container image ref in SonataFlow resource
run: yq -i '.spec.podTemplate.container.image="quay.io/orchestrator/${{ jobs.build.steps.build-image.outputs.image }}:${{ github.sha }}"' ${{ env.workflow_id }}/manifests/01-sonataflow*.yaml
- name: Archive manifests
uses: actions/upload-artifact@v3
with:
name: serverless-workflow-${{ env.workflow_id }}
path: ${{ env.workflow_id }}/manifests