Skip to content

Commit

Permalink
292 add a docker image publish (#294)
Browse files Browse the repository at this point in the history
* trying to publish an image

* trying to build exactly one dockerfile for publish

* newer build and push

* maybe now

* removing unused package

* trying to do a multiplatform build

* just arm and amd then?

* merging main

* trying only arm64

* adding qemu to try to use more platforms

* just publishing one package

* publishing only on release
  • Loading branch information
K20shores authored Oct 10, 2023
1 parent d1f27f3 commit 688fdae
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Create and publish a Docker image

on:
push:
branches: ['release']
tags:
- '*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
file: docker/Dockerfile.publish
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
27 changes: 27 additions & 0 deletions docker/Dockerfile.publish
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM fedora:37

RUN dnf -y update \
&& dnf -y install \
cmake \
gcc-c++ \
gdb \
git \
make \
zlib-devel \
llvm-devel \
&& dnf clean all

# copy the MICM code
COPY . /micm/

# build the library and run the tests
RUN mkdir /build \
&& cd /build \
&& cmake \
-D CMAKE_BUILD_TYPE=release \
-D ENABLE_LLVM:BOOL=TRUE \
-D ENABLE_JSON:BOOL=TRUE \
../micm \
&& make install -j 8

WORKDIR /build

0 comments on commit 688fdae

Please sign in to comment.