Compare commits
15 Commits
eed9e30fd3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ca282ca3f | |||
| c14328a4bb | |||
| f5e52b58e0 | |||
|
|
8b3527b4c6 | ||
| a71579b801 | |||
|
|
d043ce840b | ||
| ab31ba039b | |||
|
|
a7462b5e29 | ||
| e4c90f8750 | |||
|
|
7dd6131ce1 | ||
| ebd9a6af70 | |||
|
|
c1a4111814 | ||
| e6b359cc9b | |||
| ed0345fd3e | |||
|
|
9520f8b5c9 |
85
.github/workflows/deploy-docker-to-tst.yml
vendored
Normal file
85
.github/workflows/deploy-docker-to-tst.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
name: Docker Image CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
tags:
|
||||||
|
- "docker-build-*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Stap 1: Code ophalen
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Stap 2: Versienummer ophalen uit package.json en opslaan als artifact
|
||||||
|
- name: Extract Angular version
|
||||||
|
run: |
|
||||||
|
echo "$(cat package.json | jq -r '.version')" > version.txt
|
||||||
|
- name: Save version as artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: version
|
||||||
|
path: version.txt
|
||||||
|
|
||||||
|
# Stap 3: Inloggen bij Docker Hub
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
# Stap 4: Docker-image bouwen en taggen met Angular-versie
|
||||||
|
- name: Build the Docker image
|
||||||
|
run: |
|
||||||
|
VERSION=$(cat version.txt)
|
||||||
|
docker buildx build . --file Dockerfile-tst --tag veenm/paypoint:$VERSION-SNAPSHOT --platform linux/amd64
|
||||||
|
|
||||||
|
# Stap 5: Docker-image pushen naar Docker Hub (huidige versie tag)
|
||||||
|
- name: Push the Docker image (version-snapshot)
|
||||||
|
run: |
|
||||||
|
VERSION=$(cat version.txt)
|
||||||
|
docker push veenm/paypoint:$VERSION-SNAPSHOT
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: build-and-push
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Stap 1: Artifact ophalen
|
||||||
|
- name: Download version artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: version
|
||||||
|
|
||||||
|
# Stap 2: Lees versie uit het artifact
|
||||||
|
- name: Read version
|
||||||
|
id: read_version
|
||||||
|
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Stap 3: Maak verbinding via SSH naar de Alpine server en update de container
|
||||||
|
- name: SSH into Alpine and update Docker container
|
||||||
|
uses: appleboy/ssh-action@v0.1.10
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.ALPINE_HOST }}
|
||||||
|
username: ${{ secrets.ALPINE_USER }}
|
||||||
|
password: ${{ secrets.ALPINE_PASSWORD }}
|
||||||
|
script: |
|
||||||
|
VERSION=${{ env.VERSION }}
|
||||||
|
echo "Gekozen versie: $VERSION-SNAPSHOT"
|
||||||
|
|
||||||
|
# Stop en verwijder de huidige container
|
||||||
|
docker stop paypoint || true
|
||||||
|
docker rm paypoint || true
|
||||||
|
|
||||||
|
# Haal de nieuwste image binnen
|
||||||
|
docker pull veenm/paypoint:$VERSION-SNAPSHOT
|
||||||
|
|
||||||
|
# Start een nieuwe container
|
||||||
|
docker run -d --name paypoint --restart unless-stopped -p 15001:80 veenm/paypoint:$VERSION-SNAPSHOT
|
||||||
|
|
||||||
|
# Opruimen oude images
|
||||||
|
docker image prune -f
|
||||||
6
.github/workflows/deploy-docker.yml
vendored
6
.github/workflows/deploy-docker.yml
vendored
@@ -1,7 +1,11 @@
|
|||||||
name: Docker Image CI
|
name: Docker Image CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- "docker-build-*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
|
|||||||
15
.github/workflows/increase-version.yml
vendored
15
.github/workflows/increase-version.yml
vendored
@@ -30,6 +30,15 @@ jobs:
|
|||||||
|
|
||||||
# Push changes to remote main branch
|
# Push changes to remote main branch
|
||||||
git push origin main
|
git push origin main
|
||||||
|
|
||||||
build-and-run:
|
trigger-pipeline-b:
|
||||||
uses: ./.github/workflows/deploy-docker.yml@main
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Create and push tag
|
||||||
|
run: |
|
||||||
|
git config --global user.name "Gitea Actions"
|
||||||
|
git config --global user.email "actions@gitea.local"
|
||||||
|
git tag docker-build-$(date +%s)
|
||||||
|
git push --tags
|
||||||
22
Dockerfile-tst
Normal file
22
Dockerfile-tst
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Gebruik een multi-architecture versie van Node
|
||||||
|
FROM node:23.0.0 as build
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
RUN npm install -g @angular/cli
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN ng build --configuration=production
|
||||||
|
|
||||||
|
# Gebruik een multi-architecture versie van Nginx
|
||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
# Kopieer de gecompileerde bestanden van Angular naar de Nginx-webserver
|
||||||
|
COPY --from=build app/dist/pay-point/browser /usr/share/nginx/html
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
20
angular.json
20
angular.json
@@ -53,8 +53,8 @@
|
|||||||
"budgets": [
|
"budgets": [
|
||||||
{
|
{
|
||||||
"type": "initial",
|
"type": "initial",
|
||||||
"maximumWarning": "500kB",
|
"maximumWarning": "500MB",
|
||||||
"maximumError": "1MB"
|
"maximumError": "1000MB"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "anyComponentStyle",
|
"type": "anyComponentStyle",
|
||||||
@@ -67,7 +67,21 @@
|
|||||||
"development": {
|
"development": {
|
||||||
"optimization": false,
|
"optimization": false,
|
||||||
"extractLicenses": false,
|
"extractLicenses": false,
|
||||||
"sourceMap": true
|
"sourceMap": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.development.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.test.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "production"
|
"defaultConfiguration": "production"
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "pay-point",
|
"name": "pay-point",
|
||||||
"version": "0.0.15",
|
"version": "0.0.21",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pay-point",
|
"name": "pay-point",
|
||||||
"version": "0.0.15",
|
"version": "0.0.21",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^19.0.0",
|
"@angular/animations": "^19.0.0",
|
||||||
"@angular/cdk": "^19.0.0",
|
"@angular/cdk": "^19.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pay-point",
|
"name": "pay-point",
|
||||||
"version": "0.0.15",
|
"version": "0.0.21",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
|
|||||||
4
src/environments/environment.development.ts
Normal file
4
src/environments/environment.development.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export const environment = {
|
||||||
|
baseApi: 'http://localhost:8080/api',
|
||||||
|
production: false
|
||||||
|
};
|
||||||
4
src/environments/environment.test.ts
Normal file
4
src/environments/environment.test.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export const environment = {
|
||||||
|
baseApi: 'http://localhost:8080/api',
|
||||||
|
production: false
|
||||||
|
};
|
||||||
4
src/environments/environment.ts
Normal file
4
src/environments/environment.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export const environment = {
|
||||||
|
baseApi: 'https://api.melvanveen.nl/api',
|
||||||
|
production: true
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user