diff --git a/.env b/.env deleted file mode 100644 index 4452883..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -REACT_APP_API_URL= \ No newline at end of file diff --git a/.env.production b/.env.production deleted file mode 100644 index ed36bc0..0000000 --- a/.env.production +++ /dev/null @@ -1 +0,0 @@ -REACT_APP_API_URL="localhost:80" \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 078a243..27d5a89 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Build & Test +name: Build Mau & Deploy Mau on: push: @@ -21,11 +21,27 @@ jobs: uses: actions/checkout@main with: fetch-depth: 0 - - name: Use Node.js + - name: Setup Node.js uses: actions/setup-node@main with: node-version: 16 - name: Install dependencies run: npm install - name: Build - run: npm run build \ No newline at end of file + run: npm run build + - name: Test + run: npm test -- --watch=false + deploy: + runs-on: self-hosted + needs: build + steps: + - name: Checkout + uses: actions/checkout@main + with: + fetch-depth: 0 + - name: Create .env File + run: | + touch .env + echo "REACT_APP_API_URL=86.81.166.51:80" > .env + - name: Docker Compose + run: docker compose up -d --build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 52d0252..951f293 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ # Create a production build of the app FROM node:16.9.1 as build COPY . . -COPY .env.development .env RUN npm install --silent RUN npm run build diff --git a/public/logo192.png b/public/logo192.png index fc44b0a..79b0ebf 100644 Binary files a/public/logo192.png and b/public/logo192.png differ diff --git a/public/logo512.png b/public/logo512.png index a4e47a6..867b2bb 100644 Binary files a/public/logo512.png and b/public/logo512.png differ diff --git a/public/manifest.json b/public/manifest.json index 080d6c7..c397f55 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "React App", - "name": "Create React App Sample", + "short_name": "Mau Mau", + "name": "Mau Mau", "icons": [ { "src": "favicon.ico", diff --git a/src/App.test.tsx b/src/App.test.tsx new file mode 100644 index 0000000..af2e4b5 --- /dev/null +++ b/src/App.test.tsx @@ -0,0 +1,9 @@ +import React from 'react'; +import { render, screen } from '@testing-library/react'; +import App from './App'; + +test('Home screen contains \'MauMau\'', () => { + render(); + const linkElement = screen.getByText(/MauMau/i); + expect(linkElement).toBeInTheDocument(); +}); diff --git a/src/setupTests.ts b/src/setupTests.ts new file mode 100644 index 0000000..8f2609b --- /dev/null +++ b/src/setupTests.ts @@ -0,0 +1,5 @@ +// jest-dom adds custom jest matchers for asserting on DOM nodes. +// allows you to do things like: +// expect(element).toHaveTextContent(/react/i) +// learn more: https://github.com/testing-library/jest-dom +import '@testing-library/jest-dom';