Skip to content

Commit 1ccad76

Browse files
authored
Feature/dockerization (#6)
* Adding docker image generation * Creating Package for repository * Adjusting workflows
1 parent fc79ffe commit 1ccad76

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
compiler: [gcc, clang]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Install compiler
19+
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.compiler }}
20+
- name: Build
21+
run: make CC=${{ matrix.compiler }}

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build and Push Multiarch Docker image to GHCR
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Log in to GitHub Container Registry
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Build and push Docker image (multiarch)
31+
uses: docker/build-push-action@v5
32+
with:
33+
context: .
34+
push: true
35+
tags: ghcr.io/${{ github.repository }}:latest
36+
platforms: linux/amd64,linux/arm64

0 commit comments

Comments
 (0)