Skip to content

Commit

Permalink
Merge branch 'nextjs' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
hburn7 committed Nov 29, 2023
2 parents c8f2521 + 03c418d commit c74a9aa
Show file tree
Hide file tree
Showing 151 changed files with 8,239 additions and 20,571 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules
.next/
out/
build

.env
.env.*
.env*.local

.vercel

*.tsbuildinfo
next-env.d.ts
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
REACT_APP_OSU_CLIENT_ID=
REACT_APP_OSU_CALLBACK_URL=
REACT_APP_API_URL=
REACT_APP_ORIGIN_URL=
REACT_APP_AUTHORIZATION_SECRET=
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
72 changes: 72 additions & 0 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Web deploy

on:
push:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: nextjs

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install
run: npm ci

publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: nextjs
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: stagecodes
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
run: |
docker build -t stagecodes/otr-web-dev:latest .
docker push stagecodes/otr-web-dev:latest
deploy:
needs: publish
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: nextjs
- name: Create .env files
run: |
echo "${{ secrets.DEV_APP_ENV }}" > .env
- name: Copy files to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.DEV_SSH_HOST }}
username: ${{ secrets.DEV_SSH_USER }}
key: ${{ secrets.DEV_SSH_KEY }}
source: ".env"
target: "~/otr-web/"
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_SSH_HOST }}
username: ${{ secrets.DEV_SSH_USER }}
key: ${{ secrets.DEV_SSH_KEY }}
script: |
docker pull stagecodes/otr-web-dev:latest
docker stop otr-web-dev || true
docker rm otr-web-dev || true
docker run -d -p 3000:3000 --name otr-web-dev --env-file ~/otr-web/.env stagecodes/otr-web-dev:latest
22 changes: 17 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,34 @@
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

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

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.env
# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
56 changes: 23 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,36 @@
# Getting Started with Create React App
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Getting Started

## Available Scripts
First, run the development server:

In the project directory, you can run:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

### `npm start`
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

The page will reload if you make edits.\
You will also see any lint errors in the console.
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
## Learn More

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
To learn more about Next.js, take a look at the following resources:

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Learn More
## Deploy on Vercel

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

To learn React, check out the [React documentation](https://reactjs.org/).
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Loading

0 comments on commit c74a9aa

Please sign in to comment.