Skip to content

Commit

Permalink
update CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaswaelde committed Nov 13, 2023
1 parent bfb3fc2 commit 443b9ff
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Analysis

on:
push:
branches:
- main

jobs:
analysis:
name: Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: SonarQube Check
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
27 changes: 14 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: CI/CD Pipeline

on:
push:
Expand All @@ -8,19 +8,20 @@ on:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: sonarsource/sonarqube-scan-action@master
node-version: '20.x'

- name: Build & Push to Docker Hub
run: |
chmod +x ./scripts/push-to-docker.sh
./scripts/push-to-docker.sh
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

0 comments on commit 443b9ff

Please sign in to comment.