Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure deploy to Elastic Container Registry #21

Merged
merged 5 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/deploy-to-ecr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy to ECR

on: workflow_dispatch

env:
AWS_REGION: us-east-1
AWS_ASSUME_ROLE: arn:aws:iam::410123344539:role/github-botblend-role

permissions:
id-token: write
contents: read

jobs:
build:
name: Build Image
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
cache: maven

- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE}}
role-session-name: Github_push_session
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public

- name: Build and push image to ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REGISTRY_ALIAS: w5z6u3w9
REPOSITORY: botblend
IMAGE_TAG: latest
run: |
docker build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
Binary file added paintings/telegram-qr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
BotBlend integrates Telegram bot with Chat GPT, offering a unified platform for smooth communication.
The service also includes a user-friendly web interface for easy administration.

<img src="paintings/telegram-qr.png" width="300rem" alt="https://t.me/botblend_chat_bot">

Explore the API: [Swagger Documentation](http://ec2-51-20-251-34.eu-north-1.compute.amazonaws.com/api/swagger-ui/index.html#/)

## Technologies and Tools

- **Spring Boot:** A Java-based framework for building web applications.
Expand All @@ -23,6 +27,7 @@ The service also includes a user-friendly web interface for easy administration.

[![https://youtu.be/je94b48P8GA?si=BjrNyUUWF0zb-knZ](https://img.youtube.com/vi/USgx101zYx0/0.jpg)](https://youtu.be/USgx101zYx0)


## Functionalities

### Authentication:
Expand All @@ -45,6 +50,8 @@ Empowers administrative users to explore and manage chats and messages. Addition

## Setup and Usage

###

### Environment Configuration (.env)

To set up your environment, create a `.env` file in the project root directory and add the following content:
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/app/botblend/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ public class SecurityConfig {
private static final String AUTHORIZED_URL = "/auth/**";
private static final String ERROR_PAGE_URL = "/error";
private static final String SWAGGER_UI_ENDPOINT = "/swagger-ui/**";

private static final String SWAGGER_API_ENDPOINT = "/v3/api-docs/**";
private static final String HEALTHCHECK_ENDPOINT = "/healthcheck";

private final UserDetailsService userDetailsService;
private final JwtAuthenticationFilter jwtAuthenticationFilter;
private final ExceptionHandlerFilter exceptionHandlerFilter;
Expand All @@ -55,7 +56,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws
AUTHORIZED_URL,
ERROR_PAGE_URL,
SWAGGER_UI_ENDPOINT,
SWAGGER_API_ENDPOINT
SWAGGER_API_ENDPOINT,
HEALTHCHECK_ENDPOINT
)
.permitAll()
.anyRequest()
Expand Down