Skip to content

Fix warnings

Fix warnings #13

Workflow file for this run

name: Frontend CI/CD Pipeline
on:
push:
paths:
- frontend/**
- .github/workflows/frontend.yml
branches:
- master
- develop
tags:
- 'v*'
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore dependencies
run: |
cd frontend
npm ci
- name: Build Angular app
run: |
cd frontend
npm run build -- --configuration production
# - name: Run tests
# run: |
# cd frontend
# npm test -- --watch=false --code-coverage
docker:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
- name: Build Docker image
run: |
IMAGE_VERSION="latest"
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
IMAGE_VERSION=${GITHUB_REF#refs/tags/}
fi
docker buildx build \
-t ${{ secrets.DOCKER_HUB_USERNAME }}/frontend:${IMAGE_VERSION} \
-f ./frontend/Dockerfile \
./frontend
- name: Push Docker image to Docker Hub
if: startsWith(github.ref, 'refs/tags/')
run: |
IMAGE_VERSION=${GITHUB_REF#refs/tags/}
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/frontend:${IMAGE_VERSION}