ci: Remove dev profile and set image in the manifest #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/${{ 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 | |