Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
docker-compose*.yml
*.log
.git
56 changes: 56 additions & 0 deletions .github/workflows/build-application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and Deploy Script
on:
push:
branches:
- main
pull_request:

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

- name: Adding Node.js
uses: actions/setup-node@v4
with:
node-version: 22.16.0
cache: 'npm'

- name: Install Dependencies
run: npm install

- name: Run Unit Tests
run: npm test -- --watch=false --browsers=ChromeHeadless

- name: Build Angular App for production
run: npm run build -- --configuration=production

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: angular-dist
path: dist/
docker:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/angular-demo-application:latest
cache-from: type=gha
cache-to: type=gha,mode=max
4 changes: 0 additions & 4 deletions .vscode/extensions.json

This file was deleted.

20 changes: 0 additions & 20 deletions .vscode/launch.json

This file was deleted.

42 changes: 0 additions & 42 deletions .vscode/tasks.json

This file was deleted.

39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -------------------------------------------------
# 1) Build-Stage
# -------------------------------------------------
FROM node:22.16.0-alpine AS builder

# Arbeitsverzeichnis im Container
WORKDIR /app

# Nur package.json und lockfile kopieren, um Layer-Caching zu ermöglichen
COPY package*.json ./

# Abhängigkeiten installieren
RUN npm ci --legacy-peer-deps

# Rest des Quellcodes kopieren
COPY . .

# Angular CLI lokal installieren (falls nicht in devDependencies)
RUN npm install @angular/cli@latest --no-save

# Anwendung bauen
RUN npx ng build --configuration=production

# -------------------------------------------------
# 2) Production-Stage
# -------------------------------------------------
FROM nginx:1.25-alpine AS production

# Entferne standardmäßiges nginx HTML
RUN rm -rf /usr/share/nginx/html/*

# Kopiere die gebauten Dateien aus dem Builder
COPY --from=builder /app/dist/angular-demo-application /usr/share/nginx/html

# Exponiere Port
EXPOSE 80

# Default-Command
CMD ["nginx", "-g", "daemon off;"]
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Kirill Esau

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
31 changes: 7 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
# AngularDemoApplication
# Angular Demo Application

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.4.
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![GitHub last commit](https://img.shields.io/github/last-commit/kirillesau/angular-demo-application)
[![Build and Deploy Script](https://github.com/kirillesau/angular-demo-application/actions/workflows/build-application.yml/badge.svg?branch=master)](https://github.com/kirillesau/angular-demo-application/actions/workflows/build-application.yml)

## Development server
An example application with angular.
## Prerequisite

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
The example has been created for learning purposes only.