Skip to content

Commit 540ce0d

Browse files
committed
add vercel deploy section in readme
1 parent 4fe421e commit 540ce0d

1 file changed

Lines changed: 66 additions & 1 deletion

File tree

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This is the repository for my coding blog [nemanjamitic.com](https://nemanjamiti
88
| :----------- | :--------------------------------------- |
99
| Nginx | https://nemanjamitic.com |
1010
| Github Pages | https://nemanjam.github.io |
11+
| Vercel | https://nemanjam.vercel.app |
1112
| Docker | https://nmc-docker.arm1.nemanjamitic.com |
1213

1314
#### Self hosted mirrors
@@ -194,7 +195,71 @@ gh-pages__deploy-astro.yml
194195
gh-pages__deploy-manual.yml
195196
```
196197

197-
### 3. Docker
198+
### 3. Vercel
199+
200+
#### Deploy button
201+
202+
Just click the button bellow and follow the wizard to create a new project, set environment variables, build and deploy.
203+
204+
[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io&env=SITE_URL%2CPLAUSIBLE_DOMAIN%2CPLAUSIBLE_SCRIPT_URL&envDefaults=%7B%22SITE_URL%22%3A%22https%3A%2F%2Fmy-blog.vercel.app%22%2C%22PLAUSIBLE_DOMAIN%22%3A%22my-blog.vercel.app%22%2C%22PLAUSIBLE_SCRIPT_URL%22%3A%22https%3A%2F%2Fplausible.io%2Fjs%2Fscript.js%22%7D&envDescription=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%2Ftree%2Fvercel-deploy%2Fdocs%2Fvercel-deployment-frontend.md%23environment-variables&envLink=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%2Fblob%2Fmain%2F.env.production.example&project-name=Developer%20blog&repository-name=nemanjam.github.io&demo-title=Developer%20blog%20built%20with%20Astro%20and%20Tailwind&demo-description=Developer%20blog%20website%20with%20a%20comprehensive%20feature%20set%20and%20well%20structured%20code.&demo-url=https%3A%2F%2Fnemanjam.vercel.app&demo-image=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%2Fblob%2Fmain%2Fdocs%2Fscreenshots%2Fdeveloper-blog-screenshot-1200x630.png&skippable-integrations=1)
205+
206+
#### Local
207+
208+
Create a new Vercel project, and deploy it using Vercel CLI.
209+
210+
```bash
211+
# Install Vercel CLI
212+
pnpm install -g vercel
213+
214+
# Log in to Vercel
215+
vercel login
216+
217+
# Deploy for the first time (production)
218+
# Fill prompts for name (will determine your website url), root directory `./` (vercel.json dir)
219+
vercel --prod
220+
221+
# Set required environment variables (production)
222+
echo "https://my-blog.vercel.app" | vercel env add SITE_URL production
223+
echo "my-blog.vercel.app" | vercel env add PLAUSIBLE_DOMAIN production
224+
echo "https://plausible.io/js/script.js" | vercel env add PLAUSIBLE_SCRIPT_URL production
225+
# Set more optional variables...
226+
227+
# List existing environment variables
228+
vercel env ls
229+
230+
# Redeploy after changes
231+
vercel --prod # production
232+
233+
# After deploy, the CLI outputs the URL
234+
# Example: https://my-blog.vercel.app
235+
236+
# Debug deployment
237+
vercel inspect https://my-blog.vercel.app --json
238+
```
239+
240+
#### Github Actions
241+
242+
In Vercel dashboard create a new project and set the environment variables. In Vercel account settings create a access token and set it as `VERCEL_TOKEN` Github repository secret. In Vercel project settings copy your user id and project id and set them as `VERCEL_ORG_ID` and `VERCEL_PROJECT_ID` Github repository secrets.
243+
244+
```bash
245+
# Github repository -> Settings -> Secrets and variables -> Repository secrets
246+
247+
VERCEL_TOKEN
248+
VERCEL_ORG_ID
249+
VERCEL_PROJECT_ID
250+
```
251+
252+
Then just trigger the following workflow:
253+
254+
```bash
255+
# .github/workflows
256+
257+
# uses Vercel CLI to pull, pre-build and deploy
258+
# you must have an existing project and environment variables already defined on Vercel
259+
vercel__deploy-manual.yml
260+
```
261+
262+
### 4. Docker
198263

199264
#### Local
200265

0 commit comments

Comments
 (0)