Skip to content

Commit

Permalink
build image and push on merge (#167)
Browse files Browse the repository at this point in the history
* [CI] build libks image when pushed to master

* updated to use pr-mpt/actions-commit-hash@v2

* added mkissing new line in Dockerfile

---------

Co-authored-by: Aye Min Aung <ayemin@signalwire.com>
  • Loading branch information
ayeminag and Aye Min Aung authored Aug 2, 2023
1 parent a5c8a01 commit 8ea893b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build

on:
push:
branches:
- "master"
- "min/build-image"
workflow_call:
secrets:
# Secrets used to build
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
GH_BOT_DEPLOY_KEY:
required: true

jobs:
hash:
runs-on: ubuntu-latest
outputs:
HASH: ${{ steps.hash.outputs.short }}
steps:
- id: hash
uses: pr-mpt/actions-commit-hash@v2
with:
# NOTE: since this workflow is only triggered by `push` event
# github.sha have correct commit sha
commit: ${{ github.sha }}
build:
needs: hash
strategy:
matrix:
include:
- tag: libks-libs10-${{ needs.hash.outputs.HASH }}
baseimage: "signalwire/freeswitch-base:debian-10"
- tag: libks-libs11-${{ needs.hash.outputs.HASH }}
baseimage: "signalwire/freeswitch-base:debian-11"
name: "build libks"
uses: signalwire/actions-template/.github/workflows/ci-build.yml@main
with:
CONTAINER_SCAN: true
CONTAINER_TEST: false
PROJECT_NAME: "freeswitch-libs"
FILE: ./Dockerfile
PUSH: true
RUNNER: ubuntu-latest
TAG: ${{ matrix.tag }}
BUILD_ARGS: |
BASEIMAGE=${{ matrix.baseimage }}
secrets: inherit
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG BASE_IMAGE=signalwire/freeswitch-base:debian-10
FROM ${BASE_IMAGE}

RUN apt-get update && apt-get install -yq build-essential autotools-dev lsb-release pkg-config automake autoconf libtool-bin clang-tools-7
RUN apt-get install -yq cmake uuid-dev libssl-dev

RUN mkdir -p /sw/libks

WORKDIR /sw/libks

COPY . .

RUN sed -i -e 's/GIT_FOUND AND GZIP_CMD AND DATE_CMD/WE_DO_NOT_WANT_A_DEBIAN_PACKAGE_THANK_YOU/' CMakeLists.txt && cmake . -DCMAKE_INSTALL_PREFIX=/usr -DWITH_LIBBACKTRACE=1 && make install

0 comments on commit 8ea893b

Please sign in to comment.