14 Commits

Author SHA1 Message Date
1d51bb429d v2
Some checks failed
Test Gitea Actions Workflow / Build and Test PR (push) Has been skipped
Test Gitea Actions Workflow / Deploy React App (push) Failing after 17s
2025-12-24 19:07:24 +00:00
WdiplGit
66e78ebb46 ci-workflow-added-by-devops
Some checks failed
Test Gitea Actions Workflow / react_deploy (push) Failing after 9s
2025-12-02 19:57:06 +00:00
WdiplGit
eb8239d0b5 ci-workflow-added-by-devops
Some checks failed
Test Gitea Actions Workflow / react_deploy (push) Failing after 9s
2025-12-02 17:58:31 +00:00
WdiplGit
c8589c4946 ci-workflow-added-by-devops
All checks were successful
Test Gitea Actions Workflow / react_deploy (push) Successful in 10s
2025-12-02 17:50:26 +00:00
c3759591f0 Update index.html
All checks were successful
Test Gitea Actions Workflow / react_deploy (push) Successful in 13s
index changes
2025-12-02 07:26:54 +00:00
WdiplGit
b9c020e06e ci-workflow-added-by-devops
All checks were successful
Test Gitea Actions Workflow / react_deploy (push) Successful in 12s
2025-12-02 07:20:09 +00:00
WdiplGit
4bb3bff36f Merge branch 'beta' of http://182.50.68.145:3010/Rajendra.Reddy/reactautodeploy into beta
All checks were successful
Test Gitea Actions Workflow / react_deploy (push) Successful in 11s
2025-12-02 07:09:36 +00:00
WdiplGit
6d8a45e545 ci-workflow-added-by-devops 2025-12-02 07:06:05 +00:00
WdiplGit
f3f579a2c1 ci-workflow-added-by-devops 2025-12-02 07:04:10 +00:00
WdiplGit
6aab071801 ci-workflow-added-by-devops 2025-12-02 07:02:39 +00:00
WdiplGit
39f8a13565 ci-workflow-added-by-devops 2025-12-02 07:01:48 +00:00
633e7e6d8d Update index.html
Some checks failed
Test Gitea Actions Workflow / react_deploy (push) Failing after 12s
index updated
2025-12-02 06:55:58 +00:00
WdiplGit
463008712b ci-workflow-added-by-devops
Some checks failed
Test Gitea Actions Workflow / react_deploy (push) Failing after 10s
2025-12-01 14:00:15 +00:00
WdiplGit
90cf1873aa ci-workflow-added-by-devops 2025-12-01 13:54:06 +00:00
2 changed files with 112 additions and 31 deletions

View File

@@ -1,72 +1,151 @@
name: Test Gitea Actions Workflow name: Test Gitea Actions Workflow
on: on:
push: push:
branches: branches:
- beta
- testing
- staging
- production
pull_request:
branches:
- main
- beta - beta
- testing - testing
- client - client
- staging - staging
- production - production
jobs: jobs:
react_deploy:
build_test:
name: Build and Test PR
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout Code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: npm i --legacy-peer-deps
- name: Check Build
run: npm run build
- name: Audit Node Dependencies
run: npm audit --audit-level=critical
- name: Checkout Code (Full History)
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarQube Scan
uses: kitabisa/sonarqube-action@v1.2.0
with:
host: ${{ secrets.SONARQUBE_HOST }}
login: ${{ secrets.SONARQUBE_TOKEN }}
react_deploy:
name: Deploy React App
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
# -------------------------------------------------------- # --------------------------------------------------------
# 2. Determine Deployment Folder Based on Branch # Determine SSH Host & Deployment Folder Based on Branch
# -------------------------------------------------------- # --------------------------------------------------------
- name: Determine Deployment Path - name: Determine SSH & Deployment Path
run: | run: |
echo "Detected branch: ${{ gitea.ref_name }}" echo "Detected branch: ${{ gitea.ref_name }}"
echo BRANCH_NAME=${{ gitea.ref_name }} >> $GITHUB_ENV BRANCH_NAME="${{ gitea.ref_name }}"
case "${{ gitea.ref_name }}" in case "$BRANCH_NAME" in
beta) beta)
echo "PROJECT_PATH=deployauto" >> $GITHUB_ENV echo "DEPLOY_HOST=${{ vars.BETA_SERVER_HOST }}" >> $GITEA_ENV
echo "DEPLOY_USER=${{ vars.BETA_SERVER_USER }}" >> $GITEA_ENV
echo "DEPLOY_PASS=${{ secrets.BETA_SERVER_PASSWORD }}" >> $GITEA_ENV
echo "DEPLOY_PORT=${{ secrets.BETA_SERVER_PORT }}" >> $GITEA_ENV
echo "AUTH_TYPE=password" >> $GITEA_ENV
PROJECT_PATH="/home/deployauto/Sprint_Release"
;; ;;
testing)
echo "PROJECT_PATH=null" >> $GITHUB_ENV testing|client)
;; echo "DEPLOY_HOST=${{ vars.BETA_SERVER_HOST }}" >> $GITEA_ENV
client) echo "DEPLOY_USER=${{ vars.BETA_SERVER_USER }}" >> $GITEA_ENV
echo "PROJECT_PATH=null" >> $GITHUB_ENV echo "DEPLOY_PASS=${{ secrets.BETA_SERVER_PASSWORD }}" >> $GITEA_ENV
echo "DEPLOY_PORT=${{ secrets.BETA_SERVER_PORT }}" >> $GITEA_ENV
echo "AUTH_TYPE=password" >> $GITEA_ENV
PROJECT_PATH="null"
;; ;;
staging) staging)
echo "PROJECT_PATH=null" >> $GITHUB_ENV echo "DEPLOY_HOST=${{ vars.STAGING_SERVER_HOST }}" >> $GITEA_ENV
echo "DEPLOY_USER=${{ vars.STAGING_SERVER_USER }}" >> $GITEA_ENV
echo "DEPLOY_KEY=${{ secrets.STAGING_SERVER_PASSWORD }}" >> $GITEA_ENV
echo "DEPLOY_PORT=${{ secrets.STAGING_SERVER_PORT }}" >> $GITEA_ENV
echo "AUTH_TYPE=ssh" >> $GITEA_ENV
PROJECT_PATH="null"
;; ;;
production) production)
echo "PROJECT_PATH=null" >> $GITHUB_ENV echo "DEPLOY_HOST=${{ vars.PRODUCTION_SERVER_HOST }}" >> $GITEA_ENV
echo "DEPLOY_USER=${{ vars.PRODUCTION_SERVER_USER }}" >> $GITEA_ENV
echo "DEPLOY_KEY=${{ secrets.PRODUCTION_SERVER_PASSWORD }}" >> $GITEA_ENV
echo "DEPLOY_PORT=${{ secrets.PRODUCTION_SERVER_PORT }}" >> $GITEA_ENV
echo "AUTH_TYPE=ssh" >> $GITEA_ENV
PROJECT_PATH="null"
;; ;;
*) *)
echo "Unknown branch: ${{ gitea.ref_name }}" echo "Unknown branch: $BRANCH_NAME"
exit 1 exit 1
;; ;;
esac esac
echo "Selected PROJECT_PATH: $PROJECT_PATH" echo "PROJECT_PATH=$PROJECT_PATH" >> $GITEA_ENV
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITEA_ENV
- name: Deploy via Password Auth
if: env.AUTH_TYPE == 'password'
- name: Execute remote SSH commands using password
uses: appleboy/ssh-action@v1 uses: appleboy/ssh-action@v1
env: env:
BRANCH_NAME: ${{ env.BRANCH_NAME }} BRANCH_NAME: ${{ env.BRANCH_NAME }}
PROJECT_PATH: ${{ env.PROJECT_PATH }} PROJECT_PATH: ${{ env.PROJECT_PATH }}
with: with:
host: ${{ vars.NODE_SERVER_HOST }} host: ${{ env.DEPLOY_HOST }}
username: ${{ vars.NODE_SERVER_USER }} username: ${{ env.DEPLOY_USER }}
password: ${{ vars.NODE_SERVER_PASSWORD }} password: ${{ env.DEPLOY_PASS }}
port: ${{ vars.NODE_SERVER_PORT }} port: ${{ env.DEPLOY_PORT }}
envs: BRANCH_NAME,PROJECT_PATH envs: PROJECT_PATH,BRANCH_NAME
script: | script: |
echo "Incoming Branch : $BRANCH_NAME" cd "$PROJECT_PATH/reactautodeploy"
echo "Selected folder = $PROJECT_PATH" git pull origin $BRANCH_NAME
cd "/home/$PROJECT_PATH/reactautodeploy"
npm i && npm run build npm i && npm run build
- name: Deploy via SSH Key
if: env.AUTH_TYPE == 'ssh'
uses: appleboy/ssh-action@v1
env:
BRANCH_NAME: ${{ env.BRANCH_NAME }}
PROJECT_PATH: ${{ env.PROJECT_PATH }}
with:
host: ${{ env.DEPLOY_HOST }}
username: ${{ env.DEPLOY_USER }}
key: ${{ env.DEPLOY_KEY }}
port: ${{ env.DEPLOY_PORT }}
envs: PROJECT_PATH,BRANCH_NAME
script: |
cd "$PROJECT_PATH/reactautodeploy"
git pull origin $BRANCH_NAME
npm i && npm run build

View File

@@ -1 +1,3 @@
<html> Hi Team </html> <html> Hi Team </html>
<head> this is my head </head>
<body> <h1>this is my body but this is thin </h1> </body>