Skip to content

Commit

Permalink
Merge pull request #57 from adrianvrj/feat-add-env-var
Browse files Browse the repository at this point in the history
[feat] added ROOT to env
  • Loading branch information
adrianvrj authored Aug 28, 2024
2 parents e7b60b8 + b83a7e8 commit 6e5f6ca
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 45 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages

on:
Expand Down Expand Up @@ -29,6 +25,17 @@ defaults:
working-directory: frontend/gostarkme-web

jobs:
create-envfile:

runs-on: ubuntu-latest

steps:
- name: Make envfile
uses: SpicyPizza/create-envfile@v1
with:
ROOT: https://web3wagers.github.io/gostarkme/
file_name: frontend/gostarkme-web/.env

# Build job
build:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions frontend/gostarkme-web/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ROOT = ""
2 changes: 0 additions & 2 deletions frontend/gostarkme-web/app/guidelines/charity/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* eslint-disable react/no-unescaped-entities */
import { WelcomeBar } from "@/components/welcomepage/WelcomeBar";
import { WelcomeItems } from "@/components/welcomepage/WelcomeItems";
import Image from "next/image";

export default function CharityGuidelines() {
return (
Expand Down
13 changes: 8 additions & 5 deletions frontend/gostarkme-web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ import { LinkButton } from "@/components/ui/LinkButton";
import { WelcomeBar } from "@/components/welcomepage/WelcomeBar";
import { WelcomeItems } from "@/components/welcomepage/WelcomeItems";
import Image from "next/image";
import dotenv from 'dotenv';
export default function Home() {
dotenv.config();
const ROOT = process.env.ROOT;
return (
<main className="flex min-h-screen w-full flex-col items-center">
<WelcomeBar />
<section className="w-full max-w-screen-2xl grid grid-cols-1 md:grid-cols-2 p-10">
<div className="justify-self-center flex flex-col justify-center items-center md:items-start gap-4 p-4">
<h1 className="text-4xl font-bold">Upload your cause</h1>
<WelcomeItems text="Give it a name." src="/icons/user.png" />
<WelcomeItems text="Give a good purpose." src="/icons/target.png" />
<WelcomeItems text="Recollect Stars." src="/icons/star.png" />
<WelcomeItems text="Receive donations." src="/icons/starklogo.png" />
<WelcomeItems text="Give it a name." src={ROOT+"/icons/user.png"} />
<WelcomeItems text="Give a good purpose." src={ROOT+"/icons/target.png"} />
<WelcomeItems text="Recollect Stars." src={ROOT+"/icons/star.png"} />
<WelcomeItems text="Receive donations." src={ROOT+"/icons/starklogo.png"} />
</div>

<Image
src="/images/starcard.png"
src={ROOT +"/images/starcard.png"}
alt="stark logo"
height={771}
width={450}
Expand Down
5 changes: 4 additions & 1 deletion frontend/gostarkme-web/components/welcomepage/WelcomeBar.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import Image from "next/image";
import { LinkButton } from "../ui/LinkButton";
import dotenv from 'dotenv';

export const WelcomeBar = () => {
dotenv.config();
const ROOT = process.env.ROOT;
return (
<nav className="sticky bg-white top-0 w-full z-20 border-b-[1px] border-darkblue m-2">
<div className="max-w-screen-2xl mx-auto w-full p-4 flex flex-col md:flex-row items-center justify-between">
<span className="w-20 md:w-28" />
<div className="flex flex-col md:flex-row items-center gap-2 md:gap-4">
<Image
src="/icons/starklogo.png"
src={ROOT +"/icons/starklogo.png"}
alt="stark logo"
width={24}
height={24}
Expand Down
1 change: 1 addition & 0 deletions frontend/gostarkme-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"dotenv": "^16.4.5",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
Expand Down
122 changes: 89 additions & 33 deletions frontend/gostarkme-web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@nolyfill/[email protected]":
version "1.0.39"
resolved "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz"
integrity sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==

"@pkgjs/parseargs@^0.11.0":
version "0.11.0"
resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz"
Expand Down Expand Up @@ -497,9 +502,9 @@ camelcase-css@^2.0.1:
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==

caniuse-lite@^1.0.30001579:
version "1.0.30001651"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz"
integrity sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==
version "1.0.30001653"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001653.tgz"
integrity sha512-XGWQVB8wFQ2+9NZwZ10GxTYC5hk0Fa+q8cSkr0tgvMhYhMHP/QC+WTgrePMDBWiWc/pV+1ik82Al20XOK25Gcw==

chalk@^4.0.0:
version "4.1.2"
Expand Down Expand Up @@ -609,7 +614,7 @@ debug@^3.2.7:
dependencies:
ms "^2.1.1"

debug@^4.3.1, debug@^4.3.2, debug@^4.3.4:
debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5:
version "4.3.6"
resolved "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz"
integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==
Expand Down Expand Up @@ -694,6 +699,11 @@ doctrine@^3.0.0:
dependencies:
esutils "^2.0.2"

dotenv@^16.4.5:
version "16.4.5"
resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz"
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==

eastasianwidth@^0.2.0:
version "0.2.0"
resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz"
Expand All @@ -709,7 +719,7 @@ emoji-regex@^9.2.2:
resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz"
integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==

enhanced-resolve@^5.12.0:
enhanced-resolve@^5.15.0:
version "5.17.1"
resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz"
integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==
Expand Down Expand Up @@ -878,22 +888,23 @@ eslint-import-resolver-node@^0.3.6, eslint-import-resolver-node@^0.3.9:
resolve "^1.22.4"

eslint-import-resolver-typescript@^3.5.2:
version "3.6.1"
resolved "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz"
integrity sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==
dependencies:
debug "^4.3.4"
enhanced-resolve "^5.12.0"
eslint-module-utils "^2.7.4"
fast-glob "^3.3.1"
get-tsconfig "^4.5.0"
is-core-module "^2.11.0"
version "3.6.3"
resolved "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.3.tgz"
integrity sha512-ud9aw4szY9cCT1EWWdGv1L1XR6hh2PaRWif0j2QjQ0pgTY/69iw+W0Z4qZv5wHahOl8isEr+k/JnyAqNQkLkIA==
dependencies:
"@nolyfill/is-core-module" "1.0.39"
debug "^4.3.5"
enhanced-resolve "^5.15.0"
eslint-module-utils "^2.8.1"
fast-glob "^3.3.2"
get-tsconfig "^4.7.5"
is-bun-module "^1.0.2"
is-glob "^4.0.3"

eslint-module-utils@^2.7.4, eslint-module-utils@^2.8.0:
version "2.8.1"
resolved "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz"
integrity sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==
eslint-module-utils@^2.8.0, eslint-module-utils@^2.8.1:
version "2.8.2"
resolved "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.2.tgz"
integrity sha512-3XnC5fDyc8M4J2E8pt8pmSVRX2M+5yWMCfI/kDZwauQeFgzQOuhcRBFKjTeJagqgk4sFKxe1mvNVnaWwImx/Tg==
dependencies:
debug "^3.2.7"

Expand Down Expand Up @@ -1066,7 +1077,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==

fast-glob@^3.2.9, fast-glob@^3.3.0, fast-glob@^3.3.1:
fast-glob@^3.2.9, fast-glob@^3.3.0, fast-glob@^3.3.2:
version "3.3.2"
resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz"
integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==
Expand Down Expand Up @@ -1150,6 +1161,11 @@ fs.realpath@^1.0.0:
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==

fsevents@~2.3.2:
version "2.3.3"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

function-bind@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"
Expand Down Expand Up @@ -1190,7 +1206,7 @@ get-symbol-description@^1.0.2:
es-errors "^1.3.0"
get-intrinsic "^1.2.4"

get-tsconfig@^4.5.0:
get-tsconfig@^4.7.5:
version "4.7.6"
resolved "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.6.tgz"
integrity sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==
Expand Down Expand Up @@ -1218,16 +1234,17 @@ glob-parent@~5.1.2:
dependencies:
is-glob "^4.0.1"

glob@^10.3.10, [email protected]:
version "10.3.10"
resolved "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz"
integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==
glob@^10.3.10:
version "10.4.5"
resolved "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz"
integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==
dependencies:
foreground-child "^3.1.0"
jackspeak "^2.3.5"
minimatch "^9.0.1"
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
path-scurry "^1.10.1"
jackspeak "^3.1.2"
minimatch "^9.0.4"
minipass "^7.1.2"
package-json-from-dist "^1.0.0"
path-scurry "^1.11.1"

glob@^7.1.3:
version "7.2.3"
Expand All @@ -1241,6 +1258,17 @@ glob@^7.1.3:
once "^1.3.0"
path-is-absolute "^1.0.0"

[email protected]:
version "10.3.10"
resolved "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz"
integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==
dependencies:
foreground-child "^3.1.0"
jackspeak "^2.3.5"
minimatch "^9.0.1"
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
path-scurry "^1.10.1"

globals@^13.19.0:
version "13.24.0"
resolved "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz"
Expand Down Expand Up @@ -1411,12 +1439,19 @@ is-boolean-object@^1.1.0:
call-bind "^1.0.2"
has-tostringtag "^1.0.0"

is-bun-module@^1.0.2:
version "1.1.0"
resolved "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.1.0.tgz"
integrity sha512-4mTAVPlrXpaN3jtF0lsnPCMGnq4+qZjVIKq0HCpfcqf8OC1SM5oATCIAPM5V5FN05qp2NNnFndphmdZS9CV3hA==
dependencies:
semver "^7.6.3"

is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7:
version "1.2.7"
resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz"
integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==

is-core-module@^2.11.0, is-core-module@^2.13.0, is-core-module@^2.13.1:
is-core-module@^2.13.0, is-core-module@^2.13.1:
version "2.15.1"
resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz"
integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==
Expand Down Expand Up @@ -1586,6 +1621,15 @@ jackspeak@^2.3.5:
optionalDependencies:
"@pkgjs/parseargs" "^0.11.0"

jackspeak@^3.1.2:
version "3.4.3"
resolved "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz"
integrity sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==
dependencies:
"@isaacs/cliui" "^8.0.2"
optionalDependencies:
"@pkgjs/parseargs" "^0.11.0"

jiti@^1.21.0:
version "1.21.6"
resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz"
Expand Down Expand Up @@ -1728,6 +1772,13 @@ minimatch@^9.0.1:
dependencies:
brace-expansion "^2.0.1"

minimatch@^9.0.4:
version "9.0.5"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz"
integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==
dependencies:
brace-expansion "^2.0.1"

[email protected]:
version "9.0.3"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz"
Expand All @@ -1740,7 +1791,7 @@ minimist@^1.2.0, minimist@^1.2.6:
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==

"minipass@^5.0.0 || ^6.0.2 || ^7.0.0":
"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2:
version "7.1.2"
resolved "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz"
integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==
Expand Down Expand Up @@ -1905,6 +1956,11 @@ p-locate@^5.0.0:
dependencies:
p-limit "^3.0.2"

package-json-from-dist@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz"
integrity sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==

parent-module@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz"
Expand Down Expand Up @@ -1932,7 +1988,7 @@ path-parse@^1.0.7:
resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==

path-scurry@^1.10.1:
path-scurry@^1.10.1, path-scurry@^1.11.1:
version "1.11.1"
resolved "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz"
integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==
Expand Down Expand Up @@ -2191,7 +2247,7 @@ semver@^6.3.1:
resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.5.4:
semver@^7.5.4, semver@^7.6.3:
version "7.6.3"
resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
Expand Down

0 comments on commit 6e5f6ca

Please sign in to comment.