Skip to content

Commit

Permalink
Merge pull request #953 from ninoseki/v7.0.0
Browse files Browse the repository at this point in the history
v7.0.0
  • Loading branch information
ninoseki committed Dec 31, 2023
2 parents f5d57b9 + a0424ad commit 72fe936
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 78 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release Gem and Docker image

on:
workflow_dispatch:
Expand All @@ -16,7 +16,7 @@ jobs:
node-version:
- 20
ruby-version:
- 3.2
- 3.3
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,21 +32,35 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Buld the frontend app
- name: Buld frontend
run: |
npm install
npm run build
working-directory: frontend
- name: Copy the forntend assets
- name: Copy forntend assets
run: |
mkdir -p lib/mihari/web/public/
cp -r frontend/dist/* lib/mihari/web/public
- name: Configure Git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Release
- name: Release gem
run: bundle exec rake release
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
GEM_HOST_OTP_CODE: ${{ inputs.rubygems-otp-code }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
docker build --tag ghcr.io/$GITHUB_ACTOR/mihari:latest \
--tag ghcr.io/$GITHUB_ACTOR/mihari:${{ github.event.release.tag_name }}
- name: Push Docker image
run: |
docker push ghcr.io/$GITHUB_ACTOR/mihari:latest
docker push ghcr.io/$GITHUB_ACTOR/mihari:${{ github.event.release.tag_name }}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ruby:3.2.2-alpine3.19

ARG MIHARI_VERSION=0.0.0

RUN apk --no-cache add git build-base ruby-dev postgresql-dev && \
gem install pg && \
gem install mihari -v ${MIHARI_VERSION} && \
apk del --purge git build-base ruby-dev && \
rm -rf /usr/local/bundle/cache/*

ENTRYPOINT ["mihari"]

CMD ["--help"]
62 changes: 62 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
version: "3"
services:
database:
image: postgres:16
volumes:
- postgresql:/var/lib/postgresql/data
ports:
- ${POSTGRES_PORT:-5432}:5432
environment:
- POSTGRES_USER=${POSTGRES_USER:-user}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
- POSTGRES_DB=${POSTGRES_DB:-mihari}
restart: always

redis:
image: "redis/redis-stack:6.2.6-v10"
restart: always
ports:
- ${REDIS_PORT:-6379}:6379
- ${REDIS_INSIGHT_PORT:-8001}:8001
volumes:
- redis:/data

mihari-init:
image: ghcr.io/ninoseki/mihari:latest
environment:
- DATABASE_URL=${DATABASE_URL:-postgresql://${POSTGRES_USER:-user}:${POSTGRES_PASSWORD:-password}@database:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-mihari}}
entrypoint: ["mihari", "db", "migrate"]
depends_on:
- database

mihari:
image: ghcr.io/ninoseki/mihari:latest
ports:
- ${MIHARI_PORT:-9292}:9292
environment:
- DATABASE_URL=${DATABASE_URL:-postgresql://${POSTGRES_USER:-user}:${POSTGRES_PASSWORD:-password}@database:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-mihari}}
- REDIS_URL=${REDIS_URL:-redis://redis:${REDIS_PORT:-6379}}
env_file:
- .env
entrypoint: ["mihari", "web", "--host", "0.0.0.0"]
restart: always
depends_on:
- mihari-init

sidekiq:
image: ghcr.io/ninoseki/mihari:latest
environment:
- DATABASE_URL=${DATABASE_URL:-postgresql://${POSTGRES_USER:-user}:${POSTGRES_PASSWORD:-password}@database:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-mihari}}
- REDIS_URL=${REDIS_URL:-redis://redis:${REDIS_PORT:-6379}}
- USE_SIDEKIQ=true
env_file:
- .env
entrypoint: ["mihari", "sidekiq"]
restart: always
depends_on:
- mihari-init
- redis

volumes:
postgresql:
redis:
44 changes: 0 additions & 44 deletions docker/docker-compose.yml

This file was deleted.

Loading

0 comments on commit 72fe936

Please sign in to comment.