Skip to content

add sonarqube scan

add sonarqube scan #9

Workflow file for this run

---
name: Build demoapp-backend
# Events: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
on:
push:
branches:
- main
- release/.*
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
lint:
uses: ./.github/workflows/lint.yml # Workflow calls need to be executed as jobs
with:
yaml: true
sonarqube-scan:
runs-on: ubuntu-latest
steps:
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io/
build:
needs: sonarqube-scan
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: Set up QEMU
uses: docker/setup-qemu-action@v3 # https://github.com/marketplace/actions/docker-setup-qemu
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 # https://github.com/marketplace/actions/docker-setup-buildx
- name: Build container image
uses: docker/build-push-action@v5 # https://github.com/marketplace/actions/build-and-push-docker-images
with:
context: .
file: Containerfile
push: false
tags: demoapp-backend
cache-from: type=gha
cache-to: type=gha,mode=max