Skip to content

Commit

Permalink
add new app
Browse files Browse the repository at this point in the history
  • Loading branch information
hallipr committed Mar 22, 2024
1 parent ef568e6 commit cda1a3f
Show file tree
Hide file tree
Showing 6 changed files with 17,904 additions and 8 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: install dependencies
run: npm ci
- name: build app
run: npm run build
env:
PUBLIC_URL: /game
- name: run build.ps1
shell: pwsh
run: ./build.ps1
- name: upload artifact
uses: actions/upload-pages-artifact@v1
with:
Expand Down
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
26 changes: 26 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function LogCommand($command) {
Write-Host "> $($command | Out-String)"
& $command
}

Push-Location -Path $PSScriptRoot
try {
LogCommand { npm ci }
$ENV:PUBLIC_URL = "/new-app"
LogCommand { npm run build -ws --if-present }

if (Test-Path "./build") {
Remove-Item -Recurse -Force build
}

New-Item -ItemType Directory -Path "./build" | Out-Null

Write-Host "Copy react site to build folder"
Copy-Item -Path "./new-app/build" -Destination "./build/new-app" -Recurse -Force | Out-Null

Write-Host "Copy static site to build folder"
Copy-Item -Path "./breeding" -Destination "./build/breeding" -Recurse -Force | Out-Null
}
finally {
Pop-Location
}
4 changes: 2 additions & 2 deletions new-app/src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logo from './logo.svg';
import './App.css';
import React, { useState } from 'react';

Expand Down Expand Up @@ -30,7 +29,8 @@ function App() {
};

// select the species from values where the variant array doesn't contain "Mission", "Boss" or "Minion"
const species = values.species.filter((item) => !item.variants || !item.variants.includes("Mission") && !item.variants.includes("Boss") && !item.variants.includes("Minion"));
const excludes = ["Mission", "Boss", "Minion"];
const species = values.species.filter((item) => !item.variants || !item.variants.some(excludes.includes));

return (
<div>
Expand Down
Loading

0 comments on commit cda1a3f

Please sign in to comment.