Skip to content

Commit d0d7e30

Browse files
committed
github/workflows: Add buildyetusondemand.yml
This commit adds an action to build Yetus image on demand. This image won't be updated very often, so ondemand builds are more than enough. Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
1 parent ced7134 commit d0d7e30

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright (c) 2025, Zededa, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
---
4+
name: Yetus image - build and publish on demand
5+
on: # yamllint disable-line rule:truthy
6+
workflow_dispatch:
7+
inputs:
8+
force:
9+
description: 'Force build even if no changes'
10+
type: boolean
11+
required: false
12+
default: false
13+
14+
env:
15+
FORCE_BUILD: FORCE_BUILD=${{ inputs.force && '--force' || '' }}
16+
17+
permissions: {}
18+
19+
concurrency:
20+
group: ${{ github.workflow }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
yetus-image:
25+
# Only run for the default branch
26+
if: github.ref_name == github.event.repository.default_branch
27+
runs-on: zededa-ubuntu-2204
28+
permissions:
29+
contents: read
30+
env:
31+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
32+
REPO_NAME: ${{ github.event.repository.full_name }}
33+
IMG_NAME: "rene/eve-yetus"
34+
IMG_TAG: "0.15.1-eve-1"
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
arch: [amd64, arm64]
39+
40+
steps:
41+
- name: Starting Report
42+
run: |
43+
echo Git Ref: "${HEAD_REF}"
44+
echo GitHub Event: ${{ github.event_name }}
45+
echo Disk usage
46+
df -h
47+
echo Memory
48+
free -m
49+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
50+
with:
51+
repository: ${{ github.event.pull_request.head.repo.full_name }}
52+
ref: ${{ github.event.pull_request.head.ref }}
53+
fetch-depth: 0
54+
persist-credentials: false
55+
- name: Login to Docker Hub
56+
if: ${{ env.REPO_NAME == 'rene/eve' }}
57+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
58+
with:
59+
username: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }}
60+
password: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}
61+
- name: Build and push Yetus image
62+
arch:
63+
run: |
64+
docker buildx build --platform linux/${{ matrix.arch }} --push --tag ${{ env.IMG_NAME }}:${{ env.IMG_TAG }} tools/yetus
65+
- name: Post package report
66+
run: |
67+
echo Disk usage
68+
df -h
69+
echo Memory
70+
free -m
71+
- name: Clean up
72+
run: |
73+
docker system prune -f -a || :
74+
docker rm -f $(docker ps -aq) && docker volume rm -f $(docker volume ls -q) || :

0 commit comments

Comments
 (0)