update readme and deploy.yaml
Some checks failed
Build and Deploy Node App / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy Node App / build-and-deploy (push) Has been cancelled
This commit is contained in:
parent
0e6a8bdc7f
commit
38738275c8
62
.gitea/workflows/deploy.yaml
Normal file
62
.gitea/workflows/deploy.yaml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
name: Build and Deploy Node App
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Setup Node.js and pnpm
|
||||||
|
run: |
|
||||||
|
apk add --no-cache nodejs npm
|
||||||
|
npm install -g pnpm
|
||||||
|
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Cache pnpm store
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.local/share/pnpm/store/v3
|
||||||
|
# Link cache to existing lockfile
|
||||||
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pnpm-
|
||||||
|
|
||||||
|
- name: Install and Build
|
||||||
|
run: |
|
||||||
|
pnpm install
|
||||||
|
pnpm run build
|
||||||
|
|
||||||
|
# 5. DEPLOY TO STAGING
|
||||||
|
- name: Deploy to DEV (Builder)
|
||||||
|
if: github.ref == 'refs/heads/dev'
|
||||||
|
run: |
|
||||||
|
rm -rf /mnt/builder/*
|
||||||
|
|
||||||
|
# Change 'dist/*' below based on your framework:
|
||||||
|
# 👉 Vite (React, Vue), Astro: cp -r dist/*
|
||||||
|
# 👉 Create React App, SvelteKit: cp -r build/*
|
||||||
|
# 👉 Next.js (Static Export): cp -r out/*
|
||||||
|
|
||||||
|
cp -r dist/* /mnt/builder/
|
||||||
|
|
||||||
|
echo "🚀 Deployed to Dev: https://builder.pynixworld.com"
|
||||||
|
|
||||||
|
# 6. DEPLOY TO PRODUCTION
|
||||||
|
- name: Deploy to PROD (WWW)
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
run: |
|
||||||
|
rm -rf /mnt/prod/*
|
||||||
|
|
||||||
|
# Change 'dist/*' below based on your framework:
|
||||||
|
# 👉 Vite (React, Vue), Astro: cp -r dist/*
|
||||||
|
# 👉 Create React App, SvelteKit: cp -r build/*
|
||||||
|
# 👉 Next.js (Static Export): cp -r out/*
|
||||||
|
|
||||||
|
cp -r dist/* /mnt/prod/
|
||||||
|
|
||||||
|
echo "🚀 Deployed to Prod: https://www.pynixworld.com"
|
||||||
78
README.md
78
README.md
@ -1,3 +1,77 @@
|
|||||||
# node-app-builder-template
|
# 🚀 Your Personal Web Dev Lab
|
||||||
|
|
||||||
A template to get started with building node apps.
|
Welcome to your automated web development sandbox! This repository is connected directly to a robotic server. Whenever you push your code here, the server will automatically build your website and put it on the internet.
|
||||||
|
|
||||||
|
## 🌍 The Two Worlds (Environments)
|
||||||
|
|
||||||
|
This repository uses **Branches** to decide where your website goes.
|
||||||
|
|
||||||
|
- 🛠️ **The `dev` branch (Staging):** Pushing to this branch sends your site to [https://builder.pynixworld.com](https://builder.pynixworld.com). This is your playground. Break things, test new colors, and experiment here!
|
||||||
|
- 🌟 **The `main` branch (Production):** Pushing to this branch sends your site to [https://www.pynixworld.com](https://www.pynixworld.com). This is your official, live portfolio for the world to see.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💻 How to Get Started
|
||||||
|
|
||||||
|
**1. Clone this repository to your computer**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone [https://git.pynixworld.com/Moody6/node-app-builder-template.git](https://git.pynixworld.com/Moody6/node-app-builder-template.git)
|
||||||
|
cd node-app-builder-template
|
||||||
|
```
|
||||||
|
|
||||||
|
**2. Switch to your playground branch**
|
||||||
|
Always do your messy work here first!
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout -b dev
|
||||||
|
```
|
||||||
|
|
||||||
|
**3. Install the packages**
|
||||||
|
(We recommend `pnpm` because it is super fast!)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
**4. Start coding**
|
||||||
|
Run the local server to see your changes live on your computer as you type:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 How to Put Your Site on the Internet
|
||||||
|
|
||||||
|
When you are ready to see your site on your actual domain name, just commit and push!
|
||||||
|
|
||||||
|
**To update the Test Site (`builder.pynixworld.com`):**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git add .
|
||||||
|
git commit -m "Added a cool new button"
|
||||||
|
git push origin dev
|
||||||
|
```
|
||||||
|
|
||||||
|
_(Wait about 15 seconds, then refresh your browser!)_
|
||||||
|
|
||||||
|
**To update the Live Site (`www.pynixworld.com`):**
|
||||||
|
When your test site looks perfect, merge your code into the main branch to show the world.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout main
|
||||||
|
git merge dev
|
||||||
|
git push origin main
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧰 Changing Frameworks?
|
||||||
|
|
||||||
|
This template is ready for **React (Vite), Vue, or Astro** right out of the box.
|
||||||
|
|
||||||
|
If you decide to try a different framework like Create React App, Next.js, or SvelteKit, you just need to tell the server which folder to look for.
|
||||||
|
|
||||||
|
Open `.gitea/workflows/deploy.yaml` and look for the `dist/*` folder to match your new framework (like `build/*` or `out/*`).
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user