Added deploy.yml GitHub Actions workflow for SonarQube CI/CD #1
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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: | |
| - sonarqube-test | |
| jobs: | |
| build-and-deploy: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: SonarQube scan | |
| uses: sonarsource/sonarqube-scan-action@master | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
| - name: Copy files to local app directory | |
| run: | | |
| mkdir -p ~/app | |
| cp -r * ~/app/ | |
| - name: Run start.sh to deploy | |
| run: | | |
| chmod +x ~/app/start.sh | |
| ~/app/start.sh | |