forked from libvips/libvips
-
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.
Add github action to publish docker image
- Loading branch information
1 parent
f0bb3e3
commit a47b2fa
Showing
3 changed files
with
132 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,48 @@ | ||
### C | ||
# Object files | ||
*.o | ||
|
||
# Libraries | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Build directories | ||
build/ | ||
debug/ | ||
release/ | ||
|
||
# Executables | ||
*.out | ||
### End of C | ||
|
||
### Python | ||
# Byte-compiled / optimized | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# Unit test | ||
.pytest_cache/ | ||
### End of Python | ||
|
||
### VIM | ||
# Temporary files | ||
*~ | ||
tmp | ||
tmp-* | ||
|
||
# Swap | ||
.*.swp | ||
.*.swo | ||
|
||
# Backup | ||
*.bak | ||
|
||
# Auto-generated tag files | ||
tags | ||
TAGS | ||
### End of VIM | ||
|
||
### Distribution | ||
vips-*.tar.gz | ||
### End of Distribution |
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,46 @@ | ||
name: Docker | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
Publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Login to Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,38 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /libvips | ||
COPY ./ /libvips | ||
|
||
RUN \ | ||
# Install dependencies | ||
apt-get update && \ | ||
apt-get install -y \ | ||
automake build-essential libgirepository1.0-dev \ | ||
ninja-build python3 python3-pip python3-setuptools python3-wheel \ | ||
gobject-introspection libglib2.0-dev libpng-dev \ | ||
libjpeg-turbo8-dev libwebp-dev libtiff5-dev libgif-dev \ | ||
libexif-dev libxml2-dev libpoppler-glib-dev swig \ | ||
libpango1.0-dev libmatio-dev libopenslide-dev libcfitsio-dev \ | ||
libgsf-1-dev fftw3-dev liborc-0.4-dev librsvg2-dev libimagequant-dev && \ | ||
# | ||
# Install meson from pip since the one in apt repository is outdated | ||
pip3 install meson && \ | ||
# | ||
# Build and install | ||
meson build --libdir=lib && \ | ||
cd build && meson compile && meson install && \ | ||
# | ||
# Cleanup | ||
cd / && rm -rf /libvips && \ | ||
pip3 uninstall -y meson && \ | ||
# TODO: should we keep these? | ||
apt-get remove -y automake build-essential ninja-build \ | ||
python3-pip python3-setuptools python3-wheel && \ | ||
apt-get autoremove -y && \ | ||
apt-get autoclean && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
WORKDIR /data |