diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 22f685e..7d700ba 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,8 +1,6 @@ name: CI on: - push: - branches: [ main ] workflow_dispatch: jobs: diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml new file mode 100644 index 0000000..1d99a10 --- /dev/null +++ b/.gitea/workflows/dev.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [ main ] + workflow_dispatch: + +jobs: + build-and-push: + name: Build and Push + runs-on: build-htz-01 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Build and push Docker image + run: | + docker build -t cr.jdbnet.co.uk/public/ssh:dev . + docker push cr.jdbnet.co.uk/public/ssh:dev + + sonarqube: + name: SonarQube + runs-on: build-htz-01 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create Valid Project Key + id: sonar_setup + run: | + CLEAN_KEY=$(echo "${{ gitea.repository }}" | tr '/' ':') + echo "key=$CLEAN_KEY" >> $GITHUB_OUTPUT + + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@master + continue-on-error: true + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + with: + args: > + -Dsonar.projectKey=${{ steps.sonar_setup.outputs.key }} + -Dsonar.projectName=${{ gitea.repository }} + -Dsonar.qualitygate.wait=true \ No newline at end of file