-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0158ca3
Showing
2 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: docker build | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
tags: | ||
- "v*.*.*" | ||
pull_request: | ||
branches: | ||
- "dev" | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Set variables useful for later | ||
id: useful_vars | ||
run: |- | ||
echo "::set-output name=timestamp::$(date +%s)" | ||
echo "::set-output name=short_sha::${GITHUB_SHA::8}" | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Docker meta | ||
id: docker_meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha,prefix=,format=long,event=tag | ||
type=sha | ||
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} | ||
type=raw,value=${{ github.ref_name }}-${{ steps.useful_vars.outputs.short_sha }}-${{ steps.useful_vars.outputs.timestamp }},enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to GHCR | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM debian:bookworm-slim | ||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y \ | ||
git \ | ||
wget \ | ||
pkg-config \ | ||
autoconf \ | ||
gcc \ | ||
make \ | ||
libusb-1.0-0-dev \ | ||
librtlsdr-dev \ | ||
libncurses-dev \ | ||
zlib1g-dev \ | ||
libzstd-dev \ | ||
ca-certificates | ||
|
||
# install jemalloc | ||
RUN JEMALLOC_BDIR=$(mktemp -d) && \ | ||
git clone --depth 1 https://github.com/jemalloc/jemalloc $JEMALLOC_BDIR && \ | ||
cd $JEMALLOC_BDIR && \ | ||
./autogen.sh && \ | ||
./configure --with-lg-page=14 && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
rm -rf $JEMALLOC_BDIR |