-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
48 lines (44 loc) · 1.86 KB
/
action.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
name: 'Build Deckhouse Module'
description: 'Build Deckhouse module'
inputs:
module_source:
description: 'Registry repository address for of the module, e.g., registry.example.com/module-source'
required: true
module_name:
description: 'Name of the module, e.g., my-module'
required: true
module_tag:
description: 'The version of the module to deploy to release channel, e.g., v1.21.1'
required: true
runs:
using: "composite"
steps:
- name: Build dependency images
shell: bash
run: |
source "$(werf ci-env github --as-file)"
werf build --repo=${{ inputs.module_source }}/${{ inputs.module_name }} --save-build-report --build-report-path images_tags_werf.json
env:
MODULES_MODULE_TAG: ${{ inputs.module_tag }}
- name: Bundle the module image
shell: bash
run: |
IMAGE_SRC="$(jq -r '.Images."bundle".DockerImageName' images_tags_werf.json)"
IMAGE_DST="$(jq -r '.Images.bundle.DockerRepo' images_tags_werf.json):${{ inputs.module_tag }}"
echo "✨ Bundle image : Pushing ${IMAGE_SRC} to ${IMAGE_DST}"
crane copy ${IMAGE_SRC} ${IMAGE_DST}
- name: Prepare the release-channel image
shell: bash
run: |
IMAGE_SRC="$(jq -r '.Images."release-channel-version".DockerImageName' images_tags_werf.json)"
IMAGE_DST="$(jq -r '.Images."release-channel-version".DockerRepo' images_tags_werf.json)/release:${{ inputs.module_tag }}"
echo "✨ Release-channel image : Pushing ${IMAGE_SRC} to ${IMAGE_DST}"
crane copy ${IMAGE_SRC} ${IMAGE_DST}
- name: Register ${{ inputs.module_name }} module
shell: bash
run: |
echo "✨ Register the module ${{ inputs.module_name }}"
crane append \
--oci-empty-base \
--new_layer "" \
--new_tag "${{ inputs.module_source }}:${{ inputs.module_name }}"