Skip to content

Commit 7ebae50

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 e9b30b6 commit 7ebae50

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
concurrency:
18+
group: ${{ github.workflow }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
yetus-image:
23+
# Only run for the default branch
24+
if: github.ref_name == github.event.repository.default_branch
25+
runs-on: zededa-ubuntu-2204
26+
env:
27+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
28+
REPO_NAME: ${{ github.event.repository.full_name }}
29+
IMG_NAME: "rene/eve-yetus"
30+
IMG_TAG: "0.15.1-eve-1"
31+
strategy:
32+
fail-fast: false
33+
34+
steps:
35+
- name: Starting Report
36+
run: |
37+
echo Git Ref: "${HEAD_REF}"
38+
echo GitHub Event: ${{ github.event_name }}
39+
echo Disk usage
40+
df -h
41+
echo Memory
42+
free -m
43+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
44+
with:
45+
repository: ${{ github.event.pull_request.head.repo.full_name }}
46+
ref: ${{ github.event.pull_request.head.ref }}
47+
fetch-depth: 0
48+
persist-credentials: false
49+
- name: Login to Docker Hub
50+
if: ${{ env.REPO_NAME == 'rene/eve' }}
51+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
52+
with:
53+
username: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }}
54+
password: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}
55+
- name: Build and push Yetus image
56+
run: |
57+
docker buildx build --platform linux/amd64,linux/arm64 --push --tag ${{ env.IMG_NAME }}:${{ env.IMG_TAG }} tools/yetus
58+
- name: Post package report
59+
run: |
60+
echo Disk usage
61+
df -h
62+
echo Memory
63+
free -m
64+
- name: Clean up
65+
run: |
66+
docker system prune -f -a || :
67+
docker rm -f $(docker ps -aq) && docker volume rm -f $(docker volume ls -q) || :

0 commit comments

Comments
 (0)