Re-inserting old steps.
This commit is contained in:
+41
-44
@@ -1,60 +1,57 @@
|
|||||||
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
|
||||||
|
with:
|
||||||
|
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run SonarQube Analysis
|
- name: SonarQube Scan
|
||||||
uses: sonarsource/sonarqube-scan-action@v1.0.0
|
uses: SonarSource/sonarqube-scan-action@v4.0.0
|
||||||
with:
|
env:
|
||||||
host: ${{ secrets.SONARQUBE_HOST }}
|
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||||
login: ${{ secrets.SONARQUBE_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
projectKey: ${{ github.event.repository.name }}
|
|
||||||
projectName: ${{ github.event.repository.name }}
|
|
||||||
|
|
||||||
- name: Check SonarQube Quality Gate
|
- 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
|
||||||
uses: prasiman/gocurl@v0.5.0
|
uses: prasiman/gocurl@v0.5.0
|
||||||
with:
|
with:
|
||||||
method: POST
|
method: POST
|
||||||
url: "https://${{ secrets.RINOA_GITEA_SERVER }}/api/v1/repos/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}/issues/${{ github.event.pull_request.number }}/reviews"
|
url: "https://${{ secrets.RINOA_GITEA_SERVER }}/api/v1/repos/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}/issues/${{ github.event.pull_request.number }}/reviews"
|
||||||
headers: >
|
headers: >
|
||||||
Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}
|
Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
body: |
|
body: |
|
||||||
{
|
{
|
||||||
"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
|
||||||
|
with:
|
||||||
- name: Validate Docker Compose Configuration
|
compose-file: './docker-compose.yml'
|
||||||
uses: alexesdev/docker-compose-tests-run@v1
|
|
||||||
with:
|
|
||||||
compose_file: docker-compose.yml
|
|
||||||
|
|
||||||
manual-approval:
|
manual-approval:
|
||||||
name: Manual Approval
|
name: Manual Approval
|
||||||
|
|||||||
Reference in New Issue
Block a user