Skip to content

Commit

Permalink
add .env and mySQL.yml to setup mySQL DB
Browse files Browse the repository at this point in the history
  • Loading branch information
sShaAanGg committed Oct 19, 2023
1 parent 22431ff commit a52ce11
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 26 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/mySQL.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Set up mySQL service container
on:
workflow_dispatch:
schedule:
# Test 3 times a day
- cron: '0 */8 * * *'
jobs:
runner-job:
# You must use a Linux environment when using service containers or container jobs
runs-on: ubuntu-latest

# Service containers to run with `runner-job`
services:
# Label used to access the service container
mysql:
# Docker Hub image
image: mysql:latest
env:
DB_NAME: 'library'
DB_USER: 'root'
DB_PASS: ${{ secrets.DB_PASS }}
#
ports:
# Opens tcp port 3800 on the host and service container
- 3800:3800

steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4

# Performs a clean installation of all dependencies in the `package.json` file
# For more information, see https://docs.npmjs.com/cli/ci.html
# - name: Install dependencies
# run: npm ci

- name: Connect to mySQL
# Runs a script that creates a mySQL table, populates
# the table with data, and then retrieves the data
run: mysql -u
# Environment variables used by the script to create
# a new mySQL table.
env:
DB_NAME: 'library'
DB_USER: 'root'
DB_PASS: ${{ secrets.DB_PASS }}
# The hostname used to communicate with the mySQL service container
DB_HOST: localhost
# The default mySQL port
DB_PORT: 3800

4 changes: 4 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
# mysql user: 'developer' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too
# mysql password: ${{ secrets.DatabasePassword }} # Required if "mysql user" exists. The password for the "mysql user"
- uses: actions/checkout@v3
- name: Import .sql file
run: |
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/playwright.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ selenium-debug.log
chromedriver.log

# local env files
.env
# .env
# .env.local
# .env.*.local

Expand Down
11 changes: 11 additions & 0 deletions source/back-end/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Database
DB_HOST=127.0.0.1
DB_USER=root
DB_PASS=123456
DB_NAME=library
DB_PORT=3306
RESTFUL_IP=http://192.168.4.12/restful.service.cgi?


# Logs
LOG_DIR=C:\logs

0 comments on commit a52ce11

Please sign in to comment.