Skip to content

Commit fe44d9e

Browse files
alexlovelltroyrainest
authored andcommitted
chore: add GitHub Actions workflow for building and publishing ipmi-sim
Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>
1 parent f1b81de commit fe44d9e

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and publish ipmi-sim
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'ipmi_sim/**'
9+
- 'ipmi_sim/VERSION'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out the repo
21+
uses: actions/checkout@v6
22+
23+
- name: Read version
24+
id: version
25+
run: echo "version=$(cat ipmi_sim/VERSION)" >> "$GITHUB_OUTPUT"
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v4
29+
30+
- name: Docker Login
31+
uses: docker/login-action@v4
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Docker metadata
38+
id: meta
39+
uses: docker/metadata-action@v6
40+
with:
41+
images: ghcr.io/openchami/ipmi-sim
42+
tags: |
43+
type=raw,value=latest,enable={{is_default_branch}}
44+
type=raw,value=${{ steps.version.outputs.version }}
45+
type=sha,prefix=,format=short
46+
47+
- name: Build and push
48+
uses: docker/build-push-action@v7
49+
with:
50+
context: ipmi_sim
51+
push: true
52+
tags: ${{ steps.meta.outputs.tags }}
53+
labels: ${{ steps.meta.outputs.labels }}
54+
cache-from: type=gha
55+
cache-to: type=gha,mode=max

ipmi_sim/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

0 commit comments

Comments
 (0)