-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e3563a
commit 81e1e39
Showing
16 changed files
with
322 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build Project | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
component: | ||
- { dir: 'backend', image: '$DOCKER_USERNAME/kuka-soittaa-backend' } | ||
- { | ||
dir: 'admin-panel', | ||
image: '$DOCKER_USERNAME/kuka-soittaa-admin-panel', | ||
} | ||
- { dir: 'app' } | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
PUSH_DOCKER: github.event_name != 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies for ${{ matrix.component.dir }} | ||
run: | | ||
cd ${{ matrix.component.dir }} | ||
yarn install --frozen-lockfile --non-interactive | ||
- name: Lint ${{ matrix.component.dir }} | ||
run: | | ||
cd ${{ matrix.component.dir }} | ||
yarn lint | ||
- name: Build ${{ matrix.component.dir }} | ||
run: | | ||
cd ${{ matrix.component.dir }} | ||
yarn build | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ env.DOCKER_USERNAME }} | ||
password: ${{ env.DOCKER_PASSWORD }} | ||
if: matrix.component.image && env.PUSH_DOCKER | ||
- name: Push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: ${{ matrix.component.dir }} | ||
tags: ${{ matrix.component.image }}:${{ GITHUB_HEAD_REF##*/ }} | ||
if: matrix.component.image && env.PUSH_DOCKER | ||
- name: Push Docker image with latest tag | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: ${{ matrix.component.dir }} | ||
tags: ${{ matrix.component.image }}:latest | ||
if: github.ref == 'refs/heads/main' && matrix.component.image && env.PUSH_DOCKER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint", "react"], | ||
"rules": { | ||
"react/react-in-jsx-scope": "off", | ||
"@typescript-eslint/no-non-null-asserted-optional-chain": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
"argsIgnorePattern": "^_", | ||
"varsIgnorePattern": "^_", | ||
"caughtErrorsIgnorePattern": "^_" | ||
} | ||
] | ||
}, | ||
"ignorePatterns": ["build/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import React from "react"; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import React from 'react'; | ||
|
||
test("Placeholder", () => { | ||
test('Placeholder', () => { | ||
expect(true).toBe(true); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | ||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.