Skip to content

Commit bbfc787

Browse files
Added deploy.yml GitHub Actions workflow for SonarQube CI/CD
1 parent 28cbb1b commit bbfc787

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- sonarqube-test
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: self-hosted
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: SonarQube scan
16+
uses: sonarsource/sonarqube-scan-action@master
17+
env:
18+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
19+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
20+
21+
- name: Copy files to local app directory
22+
run: |
23+
mkdir -p ~/app
24+
cp -r * ~/app/
25+
26+
- name: Run start.sh to deploy
27+
run: |
28+
chmod +x ~/app/start.sh
29+
~/app/start.sh
30+

0 commit comments

Comments
 (0)