Skip to content

Commit

Permalink
Test actions commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SalkCoding committed Dec 8, 2024
1 parent 638f38b commit 6179bd4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ jobs:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/backend:latest

- name: Set envionment variables
build-args:
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}

- name: Set environment variables
run: |
echo "MYSQL_DATABASE=${{ secrets.MYSQL_DATABASE }}" > .env
echo "MYSQL_ROOT_PASSWORD=${{ secrets.MYSQL_ROOT_PASSWORD }}" >> .env
echo "MYSQL_DATABASE=${{ secrets.DB_NAME }}" > .env
echo "MYSQL_ROOT_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env
- name: Deploy Application
uses: appleboy/[email protected]
Expand Down
9 changes: 9 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
services:
backend:
image: 'salk1104/backend:latest'
ports:
- '8080:8080'
depends_on:
- mysql
- redis

mysql:
image: 'mysql:latest'
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
ports:
- '3306:3306'

redis:
image: 'redis:latest'
ports:
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ spring:
name: OhLottery

datasource:
url: jdbc:mysql://localhost:3306/ohlottery
username: root
password:
url: jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_NAME}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver

jpa:
Expand Down

0 comments on commit 6179bd4

Please sign in to comment.