-
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
15 changed files
with
158 additions
and
59 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,82 @@ | ||
name: Deploy to Vercel | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy-frontend: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "21.2.0" | ||
|
||
- name: Install Vercel CLI | ||
run: npm install -g vercel@latest | ||
|
||
- name: List files in client directory | ||
run: ls -la ./client | ||
|
||
- name: Link and pull Vercel project for frontend | ||
run: | | ||
vercel link --yes --project ${{ secrets.FRONTEND_PROJECT_ID }} --scope ${{ secrets.VERCEL_TEAM }} --token=${{ secrets.VERCEL_TOKEN }} | ||
vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | ||
working-directory: ./client | ||
|
||
- name: Install frontend dependencies | ||
run: npm install | ||
working-directory: ./client | ||
|
||
- name: Build frontend | ||
run: npm run build | ||
working-directory: ./client | ||
|
||
- name: Deploy frontend to Vercel | ||
run: vercel --token ${{ secrets.VERCEL_TOKEN }} | ||
working-directory: ./client | ||
|
||
deploy-backend: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "21.2.0" | ||
|
||
- name: Install Vercel CLI | ||
run: npm install -g vercel@latest | ||
|
||
- name: List files in server directory | ||
run: ls -la ./server | ||
|
||
- name: Link and pull Vercel project for backend | ||
run: | | ||
vercel link --yes --project ${{ secrets.BACKEND_PROJECT_ID }} --scope ${{ secrets.VERCEL_TEAM }} --token=${{ secrets.VERCEL_TOKEN }} | ||
vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | ||
working-directory: ./server | ||
|
||
- name: Install backend dependencies | ||
run: npm install | ||
working-directory: ./server | ||
|
||
- name: Build backend | ||
run: npm run build | ||
working-directory: ./server | ||
|
||
- name: List files in client directory | ||
run: ls -la ./server | ||
|
||
- name: Deploy backend to Vercel | ||
run: vercel --token ${{ secrets.VERCEL_TOKEN }} | ||
working-directory: ./server |
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 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,38 @@ | ||
{ | ||
"version": 2, | ||
"projects": [ | ||
{ | ||
"name": "thefluenspanishh-client", | ||
"root": "client", | ||
"builds": [ | ||
{ | ||
"src": "client/package.json", | ||
"use": "@vercel/static-build", | ||
"config": { | ||
"distDir": "client/dist" | ||
} | ||
} | ||
], | ||
"routes": [{ "src": "/(.*)", "dest": "client/dist/$1" }], | ||
"rewrites": [ | ||
{ "source": "/robots.txt", "destination": "/public/robots.txt" }, | ||
{ "source": "/sitemap.xml", "destination": "/public/sitemap.xml" }, | ||
{ "source": "/(.*)", "destination": "/client/$1" } | ||
] | ||
}, | ||
{ | ||
"name": "thefluenspanishhouse-server", | ||
"root": "server", | ||
"builds": [ | ||
{ | ||
"src": "server/public/src/index.js", | ||
"use": "@vercel/node", | ||
"config": { | ||
"outputDirectory": "server/public" | ||
} | ||
} | ||
], | ||
"routes": [{ "src": "/(.*)", "dest": "server/public/src/index.js" }] | ||
} | ||
] | ||
} |