Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlucardDante committed Sep 18, 2023
1 parent 5b2d767 commit e85a9d1
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 593 deletions.
217 changes: 28 additions & 189 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# See
# - https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
# - https://docs.github.com/en/actions/learn-github-actions/contexts
# - https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md
name: docker build

on:
Expand All @@ -10,209 +6,52 @@ on:
- master
paths:
- .github/workflows/docker-build.yml
- "*.dockerfile"
- Dockerfile
- files/*
release:
types:
- published

jobs:
build_apache:
name: Build Apache variant
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# See https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

# See https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# See https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

# Build Apache httpd images
- name: Build and push experimental image
if: github.event_name == 'push'
uses: docker/build-push-action@v2
with:
file: apache.dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
push: true
tags: |
ckulka/baikal:experimental-apache
ckulka/baikal:experimental
# Get the release version by stripping build metadata from the release name
- name: Parse release tag
if: github.event_name == 'release'
run: echo DOCKER_RELEASE_TAG=${GITHUB_REF_NAME/+*/} >> $GITHUB_ENV

- name: Build and push release image
if: github.event_name == 'release'
uses: docker/build-push-action@v2
with:
file: apache.dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
push: true
tags: |
ckulka/baikal:${{ env.DOCKER_RELEASE_TAG }}-apache
ckulka/baikal:${{ env.DOCKER_RELEASE_TAG }}
ckulka/baikal:apache
ckulka/baikal:latest
build_apache_php80:
name: Build Apache variant (PHP 8.0)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# See https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

# See https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# See https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

# Build Apache httpd images
- name: Build and push experimental image
if: github.event_name == 'push'
uses: docker/build-push-action@v2
with:
file: apache-php8.0.dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
push: true
tags: |
ckulka/baikal:experimental-apache-php8.0
ckulka/baikal:experimental-php8.0
# Get the release version by stripping build metadata from the release name
- name: Parse release tag
if: github.event_name == 'release'
run: echo DOCKER_RELEASE_TAG=${GITHUB_REF_NAME/+*/} >> $GITHUB_ENV

- name: Build and push release image
if: github.event_name == 'release'
uses: docker/build-push-action@v2
with:
file: apache-php8.0.dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
push: true
tags: |
ckulka/baikal:${{ env.DOCKER_RELEASE_TAG }}-apache-php8.0
ckulka/baikal:${{ env.DOCKER_RELEASE_TAG }}-php8.0
ckulka/baikal:apache-php8.0
ckulka/baikal:latest-php8.0
build_nginx:
name: Build nginx variant
jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# See https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

# See https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# See https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

# Build nginx images
- name: Build and push experimental image
if: github.event_name == 'push'
uses: docker/build-push-action@v2
with:
file: nginx.dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
push: true
tags: ckulka/baikal:experimental-nginx

# Get the release version by stripping build metadata from the release name
- name: Parse release tag
if: github.event_name == 'release'
run: echo DOCKER_RELEASE_TAG=${GITHUB_REF_NAME/+*/} >> $GITHUB_ENV

- name: Build and push release image
if: github.event_name == 'release'
uses: docker/build-push-action@v2
with:
file: nginx.dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
push: true
tags: |
ckulka/baikal:${{ env.DOCKER_RELEASE_TAG }}-nginx
ckulka/baikal:nginx
build_nginx_php80:
name: Build nginx variant (PHP 8.0)
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

# See https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

# See https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

# See https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v1
- name: Login to Github Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build nginx images
- name: Build and push experimental image
if: github.event_name == 'push'
uses: docker/build-push-action@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
file: nginx-php8.0.dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
push: true
tags: ckulka/baikal:experimental-nginx-php8.0

# Get the release version by stripping build metadata from the release name
- name: Parse release tag
if: github.event_name == 'release'
run: echo DOCKER_RELEASE_TAG=${GITHUB_REF_NAME/+*/} >> $GITHUB_ENV
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push release image
if: github.event_name == 'release'
uses: docker/build-push-action@v2
- name: Build and push image
uses: docker/build-push-action@v5
with:
file: nginx-php8.0.dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
context: .
push: true
tags: |
ckulka/baikal:${{ env.DOCKER_RELEASE_TAG }}-nginx-php8.0
ckulka/baikal:nginx-php8.0
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
57 changes: 0 additions & 57 deletions .github/workflows/docker-test.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/dockerhub-description.yml

This file was deleted.

7 changes: 4 additions & 3 deletions nginx.dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Multi-stage build, see https://docs.docker.com/develop/develop-images/multistage-build/
FROM alpine AS builder
FROM alpine:3.18.3 AS builder

ENV VERSION 0.9.3

ADD https://github.com/sabre-io/Baikal/releases/download/$VERSION/baikal-$VERSION.zip .
RUN apk add unzip && unzip -q baikal-$VERSION.zip

# Final Docker image
FROM nginx:1
FROM nginx:1.25.2

LABEL description="Baikal is a Cal and CardDAV server, based on sabre/dav, that includes an administrative interface for easy management."
LABEL version="0.9.3"
LABEL repository="https://github.com/ckulka/baikal-docker"
LABEL repository="https://github.com/MrAlucardDante/baikal-docker-hass"
LABEL website="http://sabre.io/baikal/"

# Install dependencies: PHP (with libffi6 dependency) & SQLite3
Expand All @@ -38,6 +38,7 @@ RUN curl -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
COPY files/docker-entrypoint.d/*.sh files/docker-entrypoint.d/nginx/ /docker-entrypoint.d/
COPY --from=builder --chown=nginx:nginx baikal /var/www/baikal
COPY files/nginx.conf /etc/nginx/conf.d/default.conf
COPY --chown=nginx:nginx files/Plugin.php /var/www/baikal/vendor/sabre/dav/lib/CalDAV/Plugin.php

VOLUME /var/www/baikal/config
VOLUME /var/www/baikal/Specific
Loading

0 comments on commit e85a9d1

Please sign in to comment.