4242 echo "Files in hello-world: ${{ steps.filter.outputs.hello-world_files }}"
4343 echo "Changes: ${{ steps.filter.outputs.changes }}"
4444
45- build-image :
46- name : Build and push image
45+ for-KVM-based-monitors :
46+ name : Build changed apps
4747 needs : get-changed-files
4848 if : |
4949 needs.get-changed-files.outputs.hello-world_files != '' &&
@@ -53,109 +53,65 @@ jobs:
5353 )
5454 strategy :
5555 matrix :
56- include :
57- - arch : amd64
58- runner : ubuntu-22.04
59- - arch : arm64
60- runner : ubuntu-22.04-arm
61- runs-on : ${{ matrix.runner }}
62- steps :
63- - name : Checkout code
64- uses : actions/checkout@v4
65- with :
66- fetch-depth : 0
67-
68- - name : Set short SHA
69- run : echo "SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
70-
71- - name : Set up Docker Buildx
72- uses : docker/setup-buildx-action@v3
73-
74- - name : Log into registry ${{ env.REGISTRY }}
75- uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
76- with :
77- registry : ${{ env.REGISTRY }}
78- username : ${{ github.actor }}
79- password : ${{ secrets.GITHUB_TOKEN }}
80-
81- - name : Extract Docker metadata
82- id : meta
83- uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804
84- with :
85- images : ${{ env.REGISTRY }}/${{ github.repository }}/hello-world-${{ env.monitor }}-${{ env.framework }}
86- tags : |
87- type=sha,prefix=${{ matrix.arch }}-,format=long
88-
89- - name : Build and push
90- id : build-and-push
91- uses : docker/build-push-action@v6
92- with :
93- context : ./hello-world/${{ env.framework }}
94- tags : ${{ steps.meta.outputs.tags }}
95- labels : ${{ steps.meta.outputs.labels }}
96- platforms : linux/${{ matrix.arch }}
97- push : true
98- provenance : false
99- file : ./hello-world/${{ env.framework }}/bunnyfile-${{ env.monitor }}-${{ matrix.arch }}
100-
101- create-manifest :
102- needs : [build-image]
103- runs-on : ubuntu-22.04
104- steps :
105-
106- - name : Install Cosign
107- uses : sigstore/cosign-installer@v3.4.0
108-
109- - name : Check install!
110- run : cosign version
111-
112- - name : Log into registry ${{ env.REGISTRY }}
113- uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
114- with :
115- registry : ${{ env.REGISTRY }}
116- username : ${{ github.actor }}
117- password : ${{ secrets.GITHUB_TOKEN }}
118-
119- - name : Extract Docker metadata
120- id : meta
121- uses : docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051
122- with :
123- images : ${{ env.REGISTRY }}/${{ github.repository }}/hello-world-${{ env.monitor }}-${{ env.framework }}
124- tags : |
125- type=sha,prefix=,format=long
126-
127- - name : Create manifest
128- run : |
129- TAGS=${{ steps.meta.outputs.tags }}
130- IMAGE=${{ env.REGISTRY }}/${{ github.repository }}/hello-world-${{ env.monitor }}-${{ env.framework }}
131- docker manifest rm $TAGS || true
132- docker manifest create $TAGS \
133- --amend ${IMAGE}:amd64-${{ steps.meta.outputs.tag-names }} \
134- --amend ${IMAGE}:arm64-${{ steps.meta.outputs.tag-names }}
135- HASH=$(docker manifest push $TAGS)
136- echo "hash=$HASH" >> $GITHUB_ENV
137- echo "tags=$TAGS" >> $GITHUB_ENV
138-
139- - name : Sign the published Docker image
140- env :
141- COSIGN_EXPERIMENTAL : " true"
142- DIGEST : ${{ env.hash }}
143- TAGS : ${{ env.tags }}
144- run : |
145- cosign sign --yes ${{ env.REGISTRY_IMAGE }}@${{ env.DIGEST }} \
146- -a "repo=${{github.repository}}" \
147- -a "workflow=${{github.workflow}}" \
148- -a "ref=${{github.sha}}" \
149- -a "author=urunc-dev/unikernel-build"
150-
151- # # for-each-changed-app:
152- # # name: Build changed apps
56+ monitor : [qemu, firecracker]
57+ # #apps: ${{ fromJSON(needs.get-chnaged-files.outputs.apps) }}
58+ uses : ./.github/workflows/build_images.yml
59+ with :
60+ monitor : ${{ matrix.monitor }}
61+ secrets : inherit
62+
63+ # # build-image:
64+ # # name: Build and push image
15365# # needs: get-changed-files
66+ # # if: |
67+ # # needs.get-changed-files.outputs.hello-world_files != '' &&
68+ # # (
69+ # # contains(needs.get-changed-files.outputs.hello-world_files, 'src') ||
70+ # # contains(needs.get-changed-files.outputs.hello-world_files, 'unikraft')
71+ # # )
15472# # strategy:
15573# # matrix:
156- # # apps: ${{ fromJSON(needs.get-chnaged-files.outputs.apps) }}
157- # # uses: ./.github/workflows/build_push_unikernels.yml
158- # # with:
159- # # app: ${{ matrix.apps }}
160- # # changed: ${{ needs.get-chnaged-files.outputs[ format('{0}_files', matrix.apps) ] }}
161- # # secrets: inherit
74+ # # include:
75+ # # - arch: amd64
76+ # # runner: ubuntu-22.04
77+ # # - arch: arm64
78+ # # runner: ubuntu-22.04-arm
79+ # # runs-on: ${{ matrix.runner }}
80+ # # steps:
81+ # # - name: Checkout code
82+ # # uses: actions/checkout@v4
83+ # # with:
84+ # # fetch-depth: 0
85+ # #
86+ # # - name: Set short SHA
87+ # # run: echo "SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
88+ # #
89+ # # - name: Set up Docker Buildx
90+ # # uses: docker/setup-buildx-action@v3
91+ # #
92+ # # - name: Log into registry ${{ env.REGISTRY }}
93+ # # uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
94+ # # with:
95+ # # registry: ${{ env.REGISTRY }}
96+ # # username: ${{ github.actor }}
97+ # # password: ${{ secrets.GITHUB_TOKEN }}
98+ # #
99+ # # - name: Extract Docker metadata
100+ # # id: meta
101+ # # uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804
102+ # # with:
103+ # # images: ${{ env.REGISTRY }}/${{ github.repository }}/hello-world-${{ env.monitor }}-${{ env.framework }}
104+ # # tags: |
105+ # # type=sha,prefix=${{ matrix.arch }}-,format=long
106+ # #
107+ # # - name: Build and push
108+ # # id: build-and-push
109+ # # uses: docker/build-push-action@v6
110+ # # with:
111+ # # context: ./hello-world/${{ env.framework }}
112+ # # tags: ${{ steps.meta.outputs.tags }}
113+ # # labels: ${{ steps.meta.outputs.labels }}
114+ # # platforms: linux/${{ matrix.arch }}
115+ # # push: true
116+ # # provenance: false
117+ # # file: ./hello-world/${{ env.framework }}/bunnyfile-${{ env.monitor }}-${{ matrix.arch }}
0 commit comments