Skip to content

Commit 4d99664

Browse files
Added workflow for developer build of container
1 parent 487351b commit 4d99664

File tree

3 files changed

+80
-3
lines changed

3 files changed

+80
-3
lines changed

.github/actions/build-container-image/action.yaml

+6-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ inputs:
3232
token:
3333
required: true
3434
description: "Auth token"
35+
suffix:
36+
required: true
37+
description: "Optional suffix for -developer build of container image"
3538

3639
runs:
3740
using: "composite"
@@ -63,7 +66,7 @@ runs:
6366
id: build-and-push
6467
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
6568
with:
66-
push: ${{ github.event_name == 'push' }}
69+
push: ${{ (github.event_name == 'push') || (inputs.suffix == '-developer') }}
6770
context: .
6871
platforms: linux/${{ inputs.arch }}
6972
file: Dockerfile.${{ inputs.arch }}
@@ -72,5 +75,5 @@ runs:
7275
GITHUB_RUN_NUMBER=${{ inputs.run_number }}
7376
GITHUB_COMMIT_HASH=${{ inputs.commit_hash }}
7477
tags: |
75-
ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent:latest_${{ inputs.arch }}
76-
ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent:build-${{ inputs.run_number }}_${{ inputs.arch }}
78+
ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent${{ inputs.suffix }}:latest_${{ inputs.arch }}
79+
ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent${{ inputs.suffix }}:build-${{ inputs.run_number }}_${{ inputs.arch }}

.github/workflows/main.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
commit_hash: ${{ github.sha }}
4646
username: ${{ github.actor }}
4747
token: ${{ secrets.GITHUB_TOKEN }}
48+
suffix: ""
4849

4950
push-container-image:
5051
if: github.event_name == 'push'

.github/workflows/main_developer.yaml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Copyright 2022 Contributors to the Eclipse Foundation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
name: Build All (Developer Build)
18+
19+
on:
20+
workflow_dispatch:
21+
22+
jobs:
23+
build-container-image:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
packages: write
28+
id-token: write
29+
strategy:
30+
matrix:
31+
arch: [ amd64, arm64 ]
32+
steps:
33+
- uses: actions/checkout@v3
34+
with:
35+
submodules: recursive
36+
37+
- name: Build Docker image
38+
uses: ./.github/actions/build-container-image
39+
with:
40+
arch: ${{ matrix.arch }}
41+
run_number: ${{ github.run_number }}
42+
commit_hash: ${{ github.sha }}
43+
username: ${{ github.actor }}
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
suffix: "-developer"
46+
47+
push-container-image:
48+
runs-on: ubuntu-latest
49+
needs: build-container-image
50+
steps:
51+
- uses: actions/checkout@v3
52+
with:
53+
submodules: recursive
54+
55+
- id: repo_name
56+
uses: ASzc/change-string-case-action@v1
57+
with:
58+
string: ${{ github.repository }}
59+
60+
- name: Log into registry ghcr.io
61+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
62+
with:
63+
registry: ghcr.io
64+
username: ${{ github.actor }}
65+
password: ${{ secrets.GITHUB_TOKEN }}
66+
67+
- name: Create merged manifest and push
68+
env:
69+
REPO: ghcr.io/${{ steps.repo_name.outputs.lowercase }}
70+
run: |
71+
docker buildx imagetools create -t ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent-developer:build-${{ github.run_number }} ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent-developer:build-${{ github.run_number }}_arm64 ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent-developer:build-${{ github.run_number }}_amd64
72+
docker buildx imagetools create -t ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent-developer:latest ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent-developer:latest_arm64 ghcr.io/${{ steps.repo_name.outputs.lowercase }}/self-update-agent-developer:latest_amd64
73+

0 commit comments

Comments
 (0)