This repository was archived by the owner on Sep 8, 2025. It is now read-only.
hruser #222
This file contains hidden or 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
| 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" |