Skip to content

Matcher: Do not fetch album genres if settings say so #434

Matcher: Do not fetch album genres if settings say so

Matcher: Do not fetch album genres if settings say so #434

Workflow file for this run

name: "Front"
on:
pull_request:
branches: [ main, v3 ]
push:
branches: [ main, v3 ]
release:
types: [ published ]
defaults:
run:
working-directory: ./front
jobs:
Changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
front: ${{ steps.filter.outputs.front }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
front:
- 'front/**'
- '.github/workflows/front.yml'
Build:
needs: changes
if: ${{ needs.changes.outputs.front == 'true' && github.event_name == 'pull_request' }}
container: node:18-alpine3.18
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Restore Dependencies
uses: ./.github/actions/cache-front
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn build
Lint:
if: ${{ needs.changes.outputs.front == 'true' && github.event_name == 'pull_request' }}
container: node:18-alpine3.18
runs-on: ubuntu-latest
needs: [ Build ]
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Restore Dependencies
uses: ./.github/actions/cache-front
- name: Install Dependencies
run: yarn install
- name: Run Linter
run: yarn lint
Format:
if: ${{ needs.changes.outputs.front == 'true' && github.event_name == 'pull_request' }}
container: node:18-alpine3.18
runs-on: ubuntu-latest
needs: [ Build ]
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Restore Dependencies
uses: ./.github/actions/cache-front
- name: Install Dependencies
run: yarn install
- name: Check Format
run: yarn prettier --check src
Tests:
runs-on: ubuntu-latest
container: node:19-alpine
needs: [ Build ]
if: ${{ needs.changes.outputs.front == 'true' && always() }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Restore Dependencies
uses: ./.github/actions/cache-front
- name: Install Dependencies
run: yarn install
- name: Run unit tests with coverage
run: yarn test:cov
- name: Upload Unit Tests artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: coverage-report-front
path: ./front/coverage
Analysis:
needs: [ Tests ]
name: "Static Analysis"
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.front == 'true' && always() }}
steps:
- uses: actions/checkout@v3
- name: Downlad Coverage artifact
uses: actions/download-artifact@v3
with:
name: coverage-report-front
path: ./front/coverage
- name: Run SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: ./front
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONT }}
Dockerize:
if: ${{ needs.changes.outputs.front == 'true' && github.event_name == 'pull_request' }}
needs: [ Build ]
runs-on: ubuntu-latest
permissions:
packages: read
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker
uses: docker/build-push-action@v3
with:
context: ./front
push: false
Publish:
needs: changes
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || (needs.changes.outputs.front == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main') }}
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
arthichaud/meelo-front
ghcr.io/${{ github.repository }}-front
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: ./front
push: true
tags: ${{ github.event_name == 'release' && steps.meta.outputs.tags || 'arthichaud/meelo-front:edge' }}
labels: ${{ steps.meta.outputs.labels }}