Skip to content

Commit

Permalink
gh actions: remove hardcoded args on dockerfile and move to gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol authored May 15, 2024
1 parent 8c773bf commit a1c92e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ on: # yamllint disable-line rule:truthy
- 'README.md'
- 'sample-config.conf'
- 'sample-config.yaml'
- '.github/**'

jobs:
check_versions:
name: Develop - Version checking
runs-on: ubuntu-latest
outputs:
version: ${{ steps.sogo.outputs.VERSION }}
steps:
- name: Get latest version of SOGo
id: sogo
run: |
echo "VERSION=$(curl -s https://api.github.com/repos/Alinto/sogo/releases/latest | jq -r '.tag_name' | sed 's/SOGo-//')" >> "$GITHUB_OUTPUT"
# Builds the Dockerfile and pushes it to dockerhub and GHCR
develop:
name: Develop - Docker image
needs: check_versions
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -41,4 +54,6 @@ jobs:
with:
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
SOGO_VERSION=${{ needs.check_versions.outputs.version }}
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
ARG ARCH=amd64
ARG SOGO_VERSION=5.10.0

FROM debian:bookworm AS builder

ARG SOGO_VERSION
Expand Down Expand Up @@ -54,7 +51,7 @@ RUN apt-get update -y && \

FROM debian:bookworm-slim

ARG ARCH
ARG TARGETARCH

ENV PUID=1000
ENV PGID=1000
Expand Down Expand Up @@ -122,7 +119,7 @@ COPY supervisord.conf /opt/supervisord.conf
COPY config_parser.sh /opt/config_parser.sh
COPY entrypoint.sh /opt/entrypoint.sh

ADD https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${ARCH} /usr/bin/yq
ADD https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${TARGETARCH} /usr/bin/yq

RUN rsync -avLkq /usr/local/lib/GNUstep/ /usr/lib/GNUstep && \
rsync -avLkq /usr/local/include/GNUstep/ /usr/include/GNUstep && \
Expand Down

0 comments on commit a1c92e0

Please sign in to comment.