From c64d7a6d6e7bd90a76debec8fe39d91e516457e8 Mon Sep 17 00:00:00 2001 From: EpicOfficer Date: Mon, 15 Apr 2024 16:48:58 +0100 Subject: [PATCH] Update Docker workflow and expand README content The Docker workflow has been updated to trigger on release creation instead of a pull request. A new tag mechanism is also added to distinguish between the branch and tag events. In addition, there have been extensive amendments to the README file to present the project structure, features, and build instructions for the newly renamed 'Blink3' project. --- .github/workflows/docker-image.yml | 5 ++-- Blink3.sln | 2 ++ README.md | 43 +++++++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 59c4438..dcda34e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,7 +1,7 @@ name: Publish Docker images on: - pull_request: - branches: [ "main" ] + release: + types: [created] env: REGISTRY: ghcr.io @@ -44,6 +44,7 @@ jobs: with: images: ${{ matrix.image }} tags: | + type=ref,event=tag type=ref,event=branch type=raw,pattern=latest,value=latest type=sha,prefix=commit_, diff --git a/Blink3.sln b/Blink3.sln index ded4931..0eeb39f 100644 --- a/Blink3.sln +++ b/Blink3.sln @@ -17,7 +17,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution docker-compose.yml = docker-compose.yml Configuration\appsettings.json = Configuration\appsettings.json Configuration\appsettings.Development.json = Configuration\appsettings.Development.json + .github\workflows\build.yml = .github\workflows\build.yml .github\workflows\docker-image.yml = .github\workflows\docker-image.yml + README.md = README.md EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blink3.Tests", "Blink3.Tests\Blink3.Tests.csproj", "{D8F3BEB2-9D9B-49CD-8711-D1A4BA78C689}" diff --git a/README.md b/README.md index 8d8c456..f36aa0f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,44 @@ -# Blink +# Blink3 [![Build](https://github.com/EpicOfficer/Blink3/actions/workflows/build.yml/badge.svg)](https://github.com/EpicOfficer/Blink3/actions/workflows/build.yml) [![Publish Docker Images](https://github.com/EpicOfficer/Blink3/actions/workflows/docker-image.yml/badge.svg)](https://github.com/EpicOfficer/Blink3/actions/workflows/docker-image.yml) + +Blink3 is a .NET 8 project implemented with a multilayered architecture. This repository holds a Discord Bot solution that comes with an API, a Blazor front-end, and Discord Activity support. Multiple features, like a global to-do list and customizable wordle, are provided as well. + +## Project Structure +The application is structured into multiple layers as follows: +1. `Blink3.API`: A .NET 8 REST API that contains endpoints for the `Blink3.Web` and `Blink3.Activity` presentation layers, and includes a Discord OAuth implementation. +2. `Blink3.Web`: A Blazor WASM front-end that supports login through the API utilizing Discord OAuth, and allows users to manage the bot. +3. `Blink3.Activity`: A Work-in-Progress presentation layer which will integrate with Discord Activity. +4. `Blink3.Bot`: The main presentation layer, developed in .Net 8 using Discord.Net, responsible for running the discord bot. +5. `Blink3.DataAccess`: A layer consisting of data access repositories and an EF Core code-first DbContext. +6. `Blink3.Core`: A shared library that contains common business logic interfaces, enums, and models. + +## Features +Currently, the bot provides several commands, including: +- `/temp`: Base command to create and manage temporary Voice Channels. +- `/define`: Get the definition of an English word. +- `/wordle`: Start a new wordle game in the current channel. +- `/guess`: Attempt to guess the wordle. +- `/leaderboard`: Displays a global wordle points leaderboard. +- `/todo`: Base command for managing your to-do list. +- `/config`: Allows guild admins to change bot settings for their guild. + +## Build & Run +Blink3 includes multiple Docker images for each of the solution's parts and Docker Compose files for orchestration. The Docker Compose files included are: +- `docker-compose.yml` - The base Docker Compose file. +- `docker-compose.development.yml` - Overwrites the base configuration for local development. References the images built in the local solution. +- `docker-compose.production.yml` - Overwrites the base configuration for production environments. References the images hosted on GitHub Container Registry. + +To build and run the application using Docker Compose, you can execute the following commands: + +For local development: + + docker-compose -f docker-compose.yml -f docker-compose.development.yml up --build + +For production: + + docker-compose -f docker-compose.yml -f docker-compose.production.yml up --build + +An `.env.example` file has been included in the repository. Rename or copy this file to `.env` and replace the sample values with your actual environment values to set up your environment. + +Please note that the development Compose file references the Docker build images in the solution, while the production one uses the images from the GitHub Container Registry. \ No newline at end of file