fiveai / Cachet

📛 An open source status page system for everyone.
https://cachethq.io
BSD 3-Clause "New" or "Revised" License
101 stars 28 forks source link

Publish updated docker images on github #38

Open darkpixel opened 3 years ago

darkpixel commented 3 years ago

I'd like to see updated docker images published on GitHub.

A sample github action:

name: Docker
on:
  push:
    branches:
      - master
    tags:
      - v*
env:
  IMAGE_NAME: cachet
jobs:
    push:
      runs-on: ubuntu-latest
      if: github.event_name == 'push'
      steps:
        - uses: actions/checkout@v2
        - name: Build image
          run: docker build . --file Dockerfile --tag $IMAGE_NAME

        - name: Log into GitHub Container Registry
          run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin

        - name: Push image to GitHub Container Registry
          run: |
            IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME

            # Change all uppercase to lowercase
            IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')

            # Strip git ref prefix from version
            VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')

            # Strip "v" prefix from tag name
            [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')

            # Use Docker `latest` tag convention
            [ "$VERSION" == "master" ] && VERSION=latest

            echo IMAGE_ID=$IMAGE_ID
            echo VERSION=$VERSION

            docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
            docker push $IMAGE_ID:$VERSION
fauust commented 3 years ago

Hi! I also would like this to happen, but wouldn't it be easier to fork or ask https://github.com/CachetHQ/Docker maintainers to build a container based on this fork?

fauust commented 3 years ago

I have just tested and it seems to work with (using docker-compose up):

diff --git a/docker-compose.yml b/docker-compose.yml
index 7691d2b..8491f6d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -13,7 +13,8 @@ services:
     build:
       context: .
       args:
-        - cachet_ver=2.4
+        - cachet_ver=v2.5.0
+        - archive_url=https://github.com/fiveai/Cachet/archive/v2.5.0.tar.gz
     ports:
       - 80:8000
     links:
@@ -26,7 +27,7 @@ services:
       - DB_USERNAME=postgres
       - DB_PASSWORD=postgres
       - DB_PREFIX=chq_
-      - APP_KEY=${APP_KEY:-null}
+      - APP_KEY=base64:wQeI5J7wPPhwgtRLCtQEd1Q6CRoBHdPbZhMjHDGROwI=
       - APP_LOG=errorlog
       - APP_ENV=${APP_ENV:-production}
       - APP_DEBUG=false
darkpixel commented 3 years ago

@fauust I don't think it would be easier. The project appears to be dead/unmaintained. I'd fork it and create docker images on my own--but I don't have time to update and maintain the codebase. I'd rather see someone else do it or get the maintainers to come back. ;)

fauust commented 3 years ago

Hi! https://github.com/sedan07/CachetDocker @sedan07 is building a container that seems quite up to date, https://hub.docker.com/r/sedan07/cachet.