Skip to content

Improve code quality #84

Improve code quality

Improve code quality #84

Workflow file for this run

name: Build & Test
on: [push, pull_request]
permissions:
packages: write
contents: read
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- run: npm ci
- run: npm run build
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: SonarQube Quality Gate check
uses: sonarsource/sonarqube-quality-gate-action@master
# Force to fail step after specific time
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
build_and_push_tag:
if: startsWith(github.event.ref, 'refs/tags/')
needs: quality
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- run: npm ci
- run: npm run build
- name: Build & Push Docker image
uses: docker/build-push-action@v5.3.0
with:
push: true
context: .
tags: ghcr.io/elanis/portfolio:${{ github.head_ref || github.ref_name }}
deploy_app:
needs: build_and_push_tag
runs-on: ubuntu-latest
steps:
- name: Update infra
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.UPDATE_INFRA_TOKEN }}
repository: Dysnomia-studio/argocd-infra
event-type: update-infra