Re-inserting old steps.

This commit is contained in:
2024-12-01 23:08:18 -05:00
parent 889610101e
commit 79ef696e3d
+27 -30
View File
@@ -1,33 +1,34 @@
name: Docker Compose PR Check and Deploy
on: on:
pull_request: push:
types: [opened, synchronize, reopened]
branches: branches:
- main - main
pull_request:
types: [opened, synchronize, reopened]
name: SonarQube Scan
jobs: jobs:
setup-sonarqube: sonarqube:
name: Setup SonarQube Project and Analyze name: SonarQube Scanning & Status
runs-on: self-hosted runs-on: ubuntu-latest
steps: steps:
- name: Checkout Code - name: Checking out
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Run SonarQube Analysis
uses: sonarsource/sonarqube-scan-action@v1.0.0
with: with:
host: ${{ secrets.SONARQUBE_HOST }} # Disabling shallow clone is recommended for improving relevancy of reporting
login: ${{ secrets.SONARQUBE_TOKEN }} fetch-depth: 0
projectKey: ${{ github.event.repository.name }}
projectName: ${{ github.event.repository.name }}
- name: Check SonarQube Quality Gate - name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4.0.0
env:
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
- name: SonarQube Quality Gate Check
id: quality-gate id: quality-gate
uses: sonarsource/sonarqube-quality-gate-check@v1.1.0 uses: SonarSource/sonarqube-quality-gate-action@v1.1.0
with: env:
host: ${{ secrets.SONARQUBE_HOST }} SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
login: ${{ secrets.SONARQUBE_TOKEN }} SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
- name: Comment on Pull Request with Quality Gate Status - name: Comment on Pull Request with Quality Gate Status
id: comment-pr id: comment-pr
@@ -42,19 +43,15 @@ jobs:
"body": "SonarQube Quality Gate Status: ${{ steps.quality-gate.outputs.quality-gate-status }}" "body": "SonarQube Quality Gate Status: ${{ steps.quality-gate.outputs.quality-gate-status }}"
} }
docker-compose-test: docker-compose-dry-run:
name: Dry Run Docker Compose name: Dry Run Docker Compose
needs: setup-sonarqube
if: needs.setup-sonarqube.outputs.quality-gate == 'true'
runs-on: self-hosted runs-on: self-hosted
if: needs.sonarqube.outputs.quality-gate == 'true'
steps: steps:
- name: Checkout Code - name: Docker Compose Lint
uses: actions/checkout@v3 uses: sjafferali/docker-compose-lint-action@v0.1.2
- name: Validate Docker Compose Configuration
uses: alexesdev/docker-compose-tests-run@v1
with: with:
compose_file: docker-compose.yml compose-file: './docker-compose.yml'
manual-approval: manual-approval:
name: Manual Approval name: Manual Approval