workflow: split into branch-specific pipelines
All checks were successful
Beta CI/CD Pipeline / build-and-test (push) Successful in 34s
Beta CI/CD Pipeline / deploy-beta (push) Successful in 6s

This commit is contained in:
vickytechkey 2026-08-09 07:52:17 +05:30
parent c6f0411761
commit 73b6671798
2 changed files with 53 additions and 24 deletions

View file

@ -0,0 +1,49 @@
name: Beta CI/CD Pipeline
on:
push:
branches:
- beta
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Build
run: npm run build
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
deploy-beta:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Deploy to Beta via FTP
env:
FTP_USERNAME: ${{ secrets.BETA_FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.BETA_FTP_PASSWORD }}
FTP_HOST: ${{ secrets.FTP_HOST }}
run: |
lftp -d -u "$FTP_USERNAME","$FTP_PASSWORD" -e "set ssl:verify-certificate no; set ftp:ssl-allow yes; set ftp:ssl-force true; set ftp:ssl-protect-data true; set ftp:passive-mode true; mirror -R dist/ ./; quit" $FTP_HOST

View file

@ -1,16 +1,16 @@
name: CI/CD Pipeline name: Production CI/CD Pipeline
on: on:
push: push:
pull_request: branches:
deployment: - main
jobs: jobs:
build-and-test: build-and-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
@ -30,28 +30,8 @@ jobs:
name: dist name: dist
path: dist/ path: dist/
deploy-beta:
needs: build-and-test
if: (github.event_name == 'push' && github.ref_name == 'beta') || (github.event_name == 'deployment' && github.event.deployment.environment == 'beta')
runs-on: ubuntu-latest
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Deploy to Beta via FTP
env:
FTP_USERNAME: ${{ secrets.BETA_FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.BETA_FTP_PASSWORD }}
FTP_HOST: ${{ secrets.FTP_HOST }}
run: |
lftp -d -u "$FTP_USERNAME","$FTP_PASSWORD" -e "set ssl:verify-certificate no; set ftp:ssl-allow yes; set ftp:ssl-force true; set ftp:ssl-protect-data true; set ftp:passive-mode true; mirror -R dist/ ./; quit" $FTP_HOST
deploy-prod: deploy-prod:
needs: build-and-test needs: build-and-test
if: (github.event_name == 'push' && github.ref_name == 'main') || (github.event_name == 'deployment' && github.event.deployment.environment == 'production')
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: environment:
name: production name: production