Compare commits
No commits in common. "9c42f867e99c7344d30bde96cb76fe73e9a98d0e" and "340fde01a1fa6f17fcca52316e4425a2619e1d7c" have entirely different histories.
9c42f867e9
...
340fde01a1
29
.github/workflows/build-and-deploy.yaml
vendored
Normal file
29
.github/workflows/build-and-deploy.yaml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Build & Deploy Docker Image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: little-core-labs/get-git-tag@v3.0.1
|
||||||
|
id: tagName
|
||||||
|
with:
|
||||||
|
tagRegex: "v(.*)"
|
||||||
|
tagRegexGroup: 1
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build the Docker image
|
||||||
|
run: docker build ./backend -t jhalitaksoy/mancala-backend:$GIT_TAG_NAME
|
||||||
|
|
||||||
|
- name: Push the Docker image
|
||||||
|
run: docker push jhalitaksoy/mancala-backend:$GIT_TAG_NAME
|
||||||
@ -1,9 +0,0 @@
|
|||||||
services:
|
|
||||||
backend:
|
|
||||||
image: jhalitaksoy/mancala-backend:latest
|
|
||||||
ports:
|
|
||||||
- "5000:6000"
|
|
||||||
frontend:
|
|
||||||
image: jhalitaksoy/mancala-frontend:0.4.7
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
FROM node:20-alpine3.19 AS build
|
|
||||||
|
|
||||||
ARG SERVER_ADDRESS WS_SERVER_ADDRESS
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY package.json ./
|
|
||||||
|
|
||||||
COPY yarn.lock ./
|
|
||||||
|
|
||||||
RUN yarn install
|
|
||||||
|
|
||||||
COPY . ./
|
|
||||||
|
|
||||||
RUN yarn build
|
|
||||||
|
|
||||||
FROM nginx:stable-alpine
|
|
||||||
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
|
|
||||||
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
EXPOSE 3000
|
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 3000;
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html/;
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
export const isAlpha = true;
|
|
||||||
|
|
||||||
export type Server = {
|
|
||||||
serverAdress: string;
|
|
||||||
wsServerAdress: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const LOCAL_SERVER_ADDRESS='http://localhost:5005';
|
|
||||||
export const LOCAL_WS_SERVER_ADDRESS='http://localhost:5005';
|
|
||||||
|
|
||||||
export const server: Server = {
|
|
||||||
//@ts-ignore
|
|
||||||
serverAdress: process.env.SERVER_ADDRESS ? `${process.env.SERVER_ADDRESS}` : LOCAL_SERVER_ADDRESS,
|
|
||||||
//@ts-ignore
|
|
||||||
wsServerAdress: process.env.WS_SERVER_ADDRESS ? `${process.env.WS_SERVER_ADDRESS}` : LOCAL_WS_SERVER_ADDRESS,
|
|
||||||
}
|
|
||||||
|
|
||||||
export const RTMT_WS_PING_INTERVAL = 1000, RTMT_WS_PING_INTERVAL_BUFFER_TIME = 2000;
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mancala/backend",
|
"name": "@mancala/backend",
|
||||||
"version": "0.4.7",
|
"version": "0.4.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -19,9 +19,3 @@ yarn dev
|
|||||||
### Development Dependencies
|
### Development Dependencies
|
||||||
|
|
||||||
This package depends on the local packages `@mancala/core` and `mancala.js`. Refer to their documentation for further instructions.
|
This package depends on the local packages `@mancala/core` and `mancala.js`. Refer to their documentation for further instructions.
|
||||||
|
|
||||||
### Docker Build
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker build --build-arg SERVER_ADDRESS=http://localhost:5000 --build-arg WS_SERVER_ADDRESS=http://localhost:5000 -t mancala-frontend .
|
|
||||||
```
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mancala/frontend",
|
"name": "@mancala/frontend",
|
||||||
"version": "0.4.7",
|
"version": "0.4.5",
|
||||||
"description": "Mancala Game Frontend",
|
"description": "Mancala Game Frontend",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "parcel src/index.html",
|
"dev": "parcel src/index.html",
|
||||||
@ -24,7 +24,7 @@ const context = initContext();
|
|||||||
|
|
||||||
const MancalaApp: FunctionComponent = () => {
|
const MancalaApp: FunctionComponent = () => {
|
||||||
|
|
||||||
const { t, i18n } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [userKey, setUserKey] = useState<string | undefined>(undefined);
|
const [userKey, setUserKey] = useState<string | undefined>(undefined);
|
||||||
|
|
||||||
@ -38,12 +38,6 @@ const MancalaApp: FunctionComponent = () => {
|
|||||||
|
|
||||||
const onThemeChange = (theme: Theme) => setTheme(theme);
|
const onThemeChange = (theme: Theme) => setTheme(theme);
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
//@ts-ignore
|
|
||||||
const deviceLanguage = navigator.language || navigator.userLanguage;
|
|
||||||
i18n.changeLanguage(deviceLanguage === "tr-TR" ? "tr" : "en")
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const connectRTMT = (userKey: string) => {
|
const connectRTMT = (userKey: string) => {
|
||||||
const rtmt = context.rtmt as RTMTWS;
|
const rtmt = context.rtmt as RTMTWS;
|
||||||
rtmt.on("error", onConnectionError);
|
rtmt.on("error", onConnectionError);
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user