-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github actions to create dist in server
- Loading branch information
Showing
9 changed files
with
88 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
|
||
- name: Install Vercel CLI | ||
run: npm install -g vercel@latest | ||
|
||
- name: Deploy server to Vercel | ||
run: | | ||
echo -e "\e[34mDeploying server to Vercel...\e[0m" | ||
cd server | ||
vercel link --yes --token=${{ secrets.VERCEL_TOKEN }} | ||
vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | ||
npm install | ||
vercel build | ||
vercel deploy --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Deploy client to Vercel | ||
run: | | ||
echo -e "\e[34mDeploying client to Vercel...\e[0m" | ||
cd client | ||
vercel link --yes --token=${{ secrets.VERCEL_TOKEN }} | ||
vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | ||
npm install | ||
npm run build | ||
vercel deploy --token=${{ secrets.VERCEL_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ dev | |
dist-ssr | ||
client/dist | ||
*.local | ||
dist | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.vercel |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"version": 2, | ||
"projects": [ | ||
{ | ||
"name": "thefluentspanishhouse-server", | ||
"builds": [ | ||
{ | ||
"src": "server/package.json", | ||
"use": "@vercel/node" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "thefluentspanishhouse-client", | ||
"builds": [ | ||
{ | ||
"src": "client/package.json", | ||
"use": "@vercel/static-build", | ||
"config": { | ||
"distDir": "build" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"routes": [ | ||
{ | ||
"src": "/api/(.*)", | ||
"dest": "/server/$1" | ||
}, | ||
{ | ||
"src": "/(.*)", | ||
"dest": "/client/$1" | ||
} | ||
], | ||
"rewrites": [ | ||
{ "source": "/robots.txt", "destination": "/public/robots.txt" }, | ||
{ "source": "/sitemap.xml", "destination": "/public/sitemap.xml" }, | ||
{ "source": "/api/(.*)", "destination": "/server/api/$1" }, | ||
{ "source": "/(.*)", "destination": "/client/$1" } | ||
] | ||
} |