Skip to content

Commit

Permalink
Add Docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
gerlero committed Aug 11, 2023
1 parent 918a124 commit d0d0816
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/*.jl.*.cov
**/*.jl.cov
**/*.jl.mem
/Manifest.toml
/docs/build/
56 changes: 56 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Docker

on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:
inputs:
arm64:
description: Build multi-platform image including arm64
type: boolean
required: false
default: false

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.DOCKERHUB_REPOSITORY }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
- name: Login to DockerHub
if: github.event_name == 'push'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: |
linux/amd64
${{ (inputs.arm64 || github.event_name == 'push') && 'linux/arm64' || '' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.event_name == 'push' }}
24 changes: 24 additions & 0 deletions .github/workflows/dockerhub-description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Update Docker Hub description
on:
push:
branches:
- main
paths:
- README.md
- .github/workflows/dockerhub-description.yml
workflow_dispatch:

jobs:
dockerhub-description:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ vars.DOCKERHUB_REPOSITORY }}
short-description: ${{ github.event.repository.description }}
enable-url-completion: true
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM julia:1.9

COPY . /src

ENV JULIA_DEPOT_PATH=/usr/local/share/julia

RUN julia -e 'using Pkg; Pkg.add(path="/src"); Pkg.precompile()' \
&& rm -rf /src \
# smoke test
&& julia -e 'using Fronts'
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<img alt="Fronts.jl" src="docs/src/assets/logo.png" height="100">
[<img alt="Fronts.jl" src="docs/src/assets/logo.png" height="100">](https://github.com/gerlero/Fronts.jl)

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://gerlero.github.io/Fronts.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://gerlero.github.io/Fronts.jl/dev/)
[![Build Status](https://github.com/gerlero/Fronts.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/gerlero/Fronts.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Coverage](https://codecov.io/gh/gerlero/Fronts.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/gerlero/Fronts.jl)
[![PkgEval](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/F/Fronts.svg)](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/F/Fronts.html)
[![Docker image](https://img.shields.io/badge/docker%20image-microfluidica%2Ffronts.jl-0085a0)](https://hub.docker.com/r/microfluidica/fronts.jl)

**_Fronts_, at the speed of Julia ⚡️**

Expand Down

0 comments on commit d0d0816

Please sign in to comment.