This repository was archived by the owner on Sep 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (79 loc) · 2.58 KB
/
build.yml
File metadata and controls
90 lines (79 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Build
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
build-client:
runs-on: "ubuntu-latest"
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Lint Client
run: |
cd client
npm i
npm run lint
- name: Setup Environment Variables
run: |
cd client
echo "VITE_APP_BASE_URL=${{ secrets.VITEURL}}" > .env
echo "CLIENT_URL=${{ secrets.CLIENTURL}}".env
- name: Build Client
run: |
cd client
npm run build
- name: Push to client branch
id: push_client
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_CLIENT}}
with:
source-directory: client/build
destination-github-username: freight-capstone
destination-repository-name: admin
target-branch: "admin-frontend"
user-email: "freightadmi@gmail.com"
commit-message: "Build client"
build-server:
runs-on: "ubuntu-latest"
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 22
- name: Lint Server
run: |
cd server
npm i
npm run lint
- name: Setup Environment Variables
run: |
cd server
echo "PORT=${{ secrets.PORT}}" > .env
echo "JWT_SECRET=${{ secrets.JWT_SECRET}}" > .env
echo "JWT_REFRESH_SECRET=${{ secrets.JWT_REFRESH_SECRET}}" > .env
echo "SESSION_SECRET=${{ secrets.SESSION_SECRET}}" > .env
echo "JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY}}" > .env
echo "REFRESH_SECRET_KEY=${{ secrets.JWT_REFRESH_SECRET}}" > .env
echo "EMAIL_USER=${{ secrets.EMAIL_USER}}" > .env
echo "EMAIL_PASS=${{ secrets.EMAIL_PASS}}" > .env
echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY}}" > .env
- name: Push to server branch
id: push_server
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_SERVER }}
with:
source-directory: server
destination-github-username: freight-capstone
destination-repository-name: admin
target-branch: "admin-frontend"
user-email: "freightadmi@gmail.com"
commit-message: "Build server"