Skip to content

Commit f0fb483

Browse files
committed
.github/workflows: add main.yml for building fcode-utils upon push
This is a GitHub push action that generates a container image from docker/Dockerfile using the fcode-utils-builder image and pushes the result to ghcr.io/openbios/fcode-utils:master for public use. It is essentially a standard Debian 11.2 image with the binaries copied into /usr/bin. Note that this action also creates a zip artifact containing the binaries and localvariables directories to allow simple build testing and verification upon merge. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
1 parent ef9ab22 commit f0fb483

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build fcode-utils
2+
3+
on: [push, workflow_dispatch]
4+
5+
env:
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: ${{ github.repository }}
8+
9+
jobs:
10+
build-x86_64:
11+
runs-on: ubuntu-latest
12+
name: fcode-utils for x86_64
13+
steps:
14+
- name: Checkout fcode-utils
15+
uses: actions/checkout@v2
16+
17+
- name: Log in to the Container registry
18+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
19+
with:
20+
registry: ${{ env.REGISTRY }}
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Extract metadata (tags, labels) for Docker
25+
id: meta
26+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
27+
with:
28+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
29+
30+
- name: Build fcode-utils
31+
uses: docker://ghcr.io/openbios/fcode-utils-builder:master
32+
with:
33+
args: "bash -c \"mkdir -p $(pwd)/build-$(uname -m) && make && make DESTDIR=$(pwd)/build-$(uname -m) install\""
34+
35+
- name: Copy localvalues
36+
uses: docker://ghcr.io/openbios/fcode-utils-builder:master
37+
with:
38+
args: "bash -c \"cp -R localvalues build-$(uname -m)\""
39+
40+
- name: Store x86_64 artifacts
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: fcode-utils-x86_64
44+
path: |
45+
build-x86_64
46+
47+
- name: Build and push Docker image
48+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
49+
with:
50+
context: .
51+
file: docker/Dockerfile
52+
push: true
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}

docker/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM debian:11.2
2+
3+
COPY build-x86_64/bin/* /usr/bin

0 commit comments

Comments
 (0)