Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌻🌎 ↝ [SSG-29 SSC-17]: GLOBE Cloud/Spaceapps Challenge #158

Merged
merged 10 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
35 changes: 35 additions & 0 deletions .github/deployments/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Next.js Application

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest
name: Build Next.js App

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Build the app
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: nextjs-build
path: .next
29 changes: 29 additions & 0 deletions .github/deployments/staging.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Vercel Staging Deployment

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
push:
branches:
- development

jobs:
Deploy-Staging:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts to Vercel Staging
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_ORG_ID }} --project=${{ secrets.VERCEL_PROJECT_ID }} --env=preview
21 changes: 0 additions & 21 deletions .github/deployments/vercel.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build Next.js Application

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install dependencies
run: yarn install
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}

- name: Build the app
run: yarn build
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
67 changes: 67 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "CodeQL"

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
schedule:
- cron: '0 21 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['javascript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
29 changes: 29 additions & 0 deletions .github/workflows/vercel-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Vercel Staging Deployment

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
push:
branches:
- development

jobs:
Deploy-Staging:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts to Vercel Staging
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_ORG_ID }} --project=${{ secrets.VERCEL_PROJECT_ID }} --env=preview
16 changes: 16 additions & 0 deletions app/api/gameplay/missions/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,22 @@ const missions: Mission[] = [
id: 200000092,
name: 'Make your first SSW classification',
},
{
id: 200000010,
name: "Complete the Penguin Watch tutorial",
},
{
id: 2000000102,
name: 'Make your first PW classification',
},
{
id: 200000012,
name: "Complete the Plankton Portal tutorial",
},
{
id: 2000000122,
name: 'Make your first Plankton Portal classification',
},
];

export async function GET(req: NextRequest) {
Expand Down
7 changes: 7 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
MirandaView,
VenusView
} from './scenes';
import GlobeView from "./scenes/globe/page";

export default function Home() {
const session = useSession();
Expand Down Expand Up @@ -73,5 +74,11 @@ export default function Home() {
);
};

if (activePlanet?.id == 35) {
return (
<GlobeView />
);
};

return planetViews[activePlanet?.id] || <EarthView />;
};
8 changes: 3 additions & 5 deletions app/scenes/earth/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { EarthViewLayout } from "@/components/(scenes)/planetScene/layout";
import { InventoryStructureItem } from "@/types/Items";
import { PlanetarySystem } from "@/components/(scenes)/planetScene/orbitals/system";
import StructuresOnPlanet, { AtmosphereStructuresOnPlanet, OrbitalStructuresOnPlanet } from "@/components/(structures)/Structures";
import { SciFiPopupMenu } from "@/components/ui/popupMenu";
import AllAutomatonsOnActivePlanet from "@/components/(structures)/Auto/AllAutomatons";
import InitialiseChapterOneUser from "@/components/(scenes)/chapters/one/InitialiseUser";

Expand All @@ -17,16 +16,15 @@ const EarthView: React.FC = () => {

const { activePlanet, updatePlanetLocation } = useActivePlanet();

if (activePlanet?.id !== 69) {
if (activePlanet?.id !== 69 || 35) {
return (
<InitialiseChapterOneUser />
);
};

return (
return (
<div className="relative min-h-screen">
<EarthStructures />
<SciFiPopupMenu />
</div>
);
};
Expand Down Expand Up @@ -73,7 +71,7 @@ const EarthStructures: React.FC = () => {
handleStructuresFetch(orbital, atmosphere, surface);
} catch (error) {
console.error('Error fetching structures:', error);
}
};
}, [session?.user?.id, activePlanet?.id, supabase]);

useEffect(() => {
Expand Down
Loading
Loading