Compare commits
No commits in common. "main" and "main" have entirely different histories.
14 changed files with 128 additions and 72 deletions
107
.forgejo/workflows/build.yaml
Normal file
107
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
build:
|
||||||
|
description: "Build container"
|
||||||
|
required: true
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: container
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Get the version from git
|
||||||
|
id: version
|
||||||
|
run: echo "version=$(git describe --dirty --tags)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Check if the container should be built
|
||||||
|
id: builder
|
||||||
|
env:
|
||||||
|
RUN: ${{ toJSON(inputs.build || !contains(steps.version.outputs.version, '-')) }}
|
||||||
|
run: |
|
||||||
|
echo "run=$RUN" >> $GITHUB_OUTPUT
|
||||||
|
echo "Run build: $RUN"
|
||||||
|
|
||||||
|
- name: Info - version and if the image container should be built
|
||||||
|
env:
|
||||||
|
VERSION: ${{ steps.version.outputs.version }}
|
||||||
|
RUN: ${{ steps.builder.outputs.run }}
|
||||||
|
FORCE: ${{ toJSON(inputs.build) }}
|
||||||
|
run: |
|
||||||
|
echo "Version $VERSION, force (manual input): $FORCE, run the build: $RUN"
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
|
name: Install pnpm
|
||||||
|
with:
|
||||||
|
run_install: false
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: "pnpm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
|
- name: Update version.json from git describe
|
||||||
|
run: pnpm run version
|
||||||
|
|
||||||
|
- name: Set the version in package.json
|
||||||
|
env:
|
||||||
|
VERSION: ${{ steps.version.outputs.version }}
|
||||||
|
run: sed "s/0.0.0/${VERSION}/" -i package.json
|
||||||
|
|
||||||
|
- name: Build package (transpile ts => js)
|
||||||
|
run: ng build
|
||||||
|
|
||||||
|
- name: Set registry token for pnpm"
|
||||||
|
env:
|
||||||
|
LOCAL_NPM_TOKEN: ${{ secrets.LOCAL_NPM_TOKEN }}
|
||||||
|
run: pnpm set "//code.philo.ydns.eu/api/packages/philorg/npm/:_authToken=${LOCAL_NPM_TOKEN}"
|
||||||
|
|
||||||
|
- name: Publish
|
||||||
|
if: fromJSON(steps.builder.outputs.run)
|
||||||
|
run: pnpm publish --no-git-checks
|
||||||
|
|
||||||
|
- name: Build container
|
||||||
|
if: fromJSON(steps.builder.outputs.run)
|
||||||
|
uses: actions/buildah-build@v1
|
||||||
|
with:
|
||||||
|
image: treetrail-frontend
|
||||||
|
oci: true
|
||||||
|
labels: treetrail-frontend
|
||||||
|
tags: latest ${{ steps.version.outputs.version }}
|
||||||
|
containerfiles: |
|
||||||
|
./Containerfile
|
||||||
|
build-args: |
|
||||||
|
APP_VERSION=${{ steps.version.outputs.version }}
|
||||||
|
|
||||||
|
- name: Workaround for bug of podman-login
|
||||||
|
if: fromJSON(steps.builder.outputs.run)
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/.docker
|
||||||
|
echo "{ \"auths\": {} }" > $HOME/.docker/config.json
|
||||||
|
|
||||||
|
- name: Log in to container registry (with another workaround)
|
||||||
|
if: fromJSON(steps.builder.outputs.run)
|
||||||
|
uses: actions/podman-login@v1
|
||||||
|
with:
|
||||||
|
registry: ${{ vars.REGISTRY }}
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
auth_file_path: /tmp/auth.json
|
||||||
|
|
||||||
|
- name: Push the image to the registry
|
||||||
|
if: fromJSON(steps.builder.outputs.run)
|
||||||
|
uses: actions/push-to-registry@v2
|
||||||
|
with:
|
||||||
|
registry: "docker://${{ vars.REGISTRY }}/${{ vars.ORGANISATION }}"
|
||||||
|
image: treetrail-frontend
|
||||||
|
tags: latest ${{ steps.version.outputs.version }}
|
|
@ -1,50 +0,0 @@
|
||||||
when:
|
|
||||||
- event: manual
|
|
||||||
- event: tag
|
|
||||||
|
|
||||||
#depends_on:
|
|
||||||
#- test
|
|
||||||
|
|
||||||
steps:
|
|
||||||
npm:
|
|
||||||
image: code.philo.ydns.eu/philorg/pnpm-deb
|
|
||||||
environment:
|
|
||||||
ORG: philorg
|
|
||||||
REGISTRY_TOKEN:
|
|
||||||
from_secret: registry_token
|
|
||||||
volumes:
|
|
||||||
- pnpm:/root/.local/share/pnpm
|
|
||||||
commands:
|
|
||||||
- pnpm install --frozen-lockfile
|
|
||||||
- pnpm set "//code.philo.ydns.eu/api/packages/$ORG/npm/:_authToken=$REGISTRY_TOKEN"
|
|
||||||
- pnpm publish --no-git-checks
|
|
||||||
failure: ignore
|
|
||||||
|
|
||||||
build:
|
|
||||||
image: code.philo.ydns.eu/philorg/pnpm-deb
|
|
||||||
commands:
|
|
||||||
- pnpm build
|
|
||||||
|
|
||||||
build_publish:
|
|
||||||
image: quay.io/podman/stable:latest
|
|
||||||
# Caution: This image is built daily. It might fill up your image store quickly.
|
|
||||||
#pull: true
|
|
||||||
volumes:
|
|
||||||
- containers:/var/lib/containers
|
|
||||||
- pnpm:/root/.local/share/pnpm
|
|
||||||
# Fill in the trusted checkbox in Woodpecker's settings as well
|
|
||||||
privileged: true
|
|
||||||
environment:
|
|
||||||
registry: code.philo.ydns.eu
|
|
||||||
org: philorg
|
|
||||||
container_name: treetrail-frontend
|
|
||||||
registry_token:
|
|
||||||
from_secret: registry_token
|
|
||||||
commands:
|
|
||||||
# Login at the registry
|
|
||||||
- podman login -u __token__ --password $registry_token $registry
|
|
||||||
# Build the container image
|
|
||||||
- podman build --volume=/var/lib/containers:/var/lib/containers --tag $registry/$org/$container_name:latest --tag $registry/$org/$container_name:$CI_COMMIT_TAG .
|
|
||||||
# Push the image
|
|
||||||
- podman push $registry/$org/$container_name:latest
|
|
||||||
- podman push $registry/$org/$container_name:$CI_COMMIT_TAG
|
|
11
README.md
11
README.md
|
@ -1,10 +1,5 @@
|
||||||
# Treetrail web front-end
|
Front-end for *Tree Trail*, a fun and pedagogic tool to discover the trails and trees around.
|
||||||
|
|
||||||
Front-end for *Tree Trail*, a fun and pedagogic tool
|
Home page (source, bugs, etc): <https://code.philo.ydns.eu/philorg/treetrail-frontend> .
|
||||||
to discover the trails and trees around.
|
|
||||||
|
|
||||||
Home page (source, bugs, etc):
|
The main documentation for Tree Trail is: <https://code.philo.ydns.eu/philorg/treetrail-backend> .
|
||||||
<https://code.philo.ydns.eu/philorg/treetrail-frontend> .
|
|
||||||
|
|
||||||
The main documentation for Tree Trail is:
|
|
||||||
<https://code.philo.ydns.eu/philorg/treetrail-backend> .
|
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "treetrail",
|
"name": "treetrail",
|
||||||
"version": "0.4.5",
|
"version": "0.0.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "treetrail",
|
"name": "treetrail",
|
||||||
"version": "0.4.5",
|
"version": "0.0.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^18.2.6",
|
"@angular/animations": "^18.2.6",
|
||||||
"@angular/cdk": "^18.2.6",
|
"@angular/cdk": "^18.2.6",
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
{
|
{
|
||||||
"name": "treetrail-frontend",
|
"name": "treetrail-frontend",
|
||||||
"version": "0.4.5",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve --proxy-config proxy.conf.json --port 4201 --serve-path /treetrail --host 0.0.0.0",
|
"start": "ng serve --proxy-config proxy.conf.json --port 4201 --serve-path /treetrail",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"openapi-ts": "openapi-ts"
|
"openapi-ts": "openapi-ts",
|
||||||
|
"version": "echo \"{\\\"version\\\":\\\"$(git describe --tags --dirty --always)\\\"}\" > src/version.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^18.2.6",
|
"@angular/animations": "^18.2.6",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Component, OnInit } from '@angular/core'
|
import { Component, OnInit } from '@angular/core'
|
||||||
|
|
||||||
import { ConfigService } from '../config.service'
|
import { ConfigService } from '../config.service'
|
||||||
import packageJson from '../../../package.json'
|
import versionJson from '../../version.json'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-about',
|
selector: 'app-about',
|
||||||
|
@ -13,7 +13,7 @@ export class AboutComponent implements OnInit {
|
||||||
public configService: ConfigService,
|
public configService: ConfigService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
public version: string = packageJson.version
|
public version: string = versionJson.version
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
|
0
src/app/app.component.scss
Normal file
0
src/app/app.component.scss
Normal file
|
@ -1,7 +1,5 @@
|
||||||
import {
|
import { Component, OnInit,
|
||||||
Component, OnInit,
|
ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core'
|
||||||
ChangeDetectorRef, ChangeDetectionStrategy
|
|
||||||
} from '@angular/core'
|
|
||||||
import { DataService } from './data.service'
|
import { DataService } from './data.service'
|
||||||
|
|
||||||
import { ActionService } from './action.service'
|
import { ActionService } from './action.service'
|
||||||
|
@ -12,6 +10,7 @@ import { combineLatest } from 'rxjs'
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
|
styleUrls: ['./app.component.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit {
|
export class AppComponent implements OnInit {
|
||||||
|
@ -21,7 +20,7 @@ export class AppComponent implements OnInit {
|
||||||
public actionService: ActionService,
|
public actionService: ActionService,
|
||||||
public appUpdateService: AppUpdateService,
|
public appUpdateService: AppUpdateService,
|
||||||
public cdr: ChangeDetectorRef,
|
public cdr: ChangeDetectorRef,
|
||||||
) { }
|
) {}
|
||||||
title = 'treetrail'
|
title = 'treetrail'
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
0
src/app/profile/profile.component.scss
Normal file
0
src/app/profile/profile.component.scss
Normal file
|
@ -3,6 +3,7 @@ import { Component } from '@angular/core';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-profile',
|
selector: 'app-profile',
|
||||||
templateUrl: './profile.component.html',
|
templateUrl: './profile.component.html',
|
||||||
|
styleUrls: ['./profile.component.scss']
|
||||||
})
|
})
|
||||||
export class ProfileComponent {
|
export class ProfileComponent {
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Router } from '@angular/router'
|
||||||
|
|
||||||
import { ActionService } from '../action.service'
|
import { ActionService } from '../action.service'
|
||||||
import { ConfigService, Config } from '../config.service'
|
import { ConfigService, Config } from '../config.service'
|
||||||
import packageJson from '../../../package.json'
|
import versionJson from '../../version.json'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-settings',
|
selector: 'app-settings',
|
||||||
|
@ -18,7 +18,7 @@ export class SettingsComponent implements OnInit {
|
||||||
public router: Router,
|
public router: Router,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
public version: string = packageJson.version
|
public version: string = versionJson.version
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.configService.conf.subscribe(
|
this.configService.conf.subscribe(
|
||||||
|
|
0
src/assets/.gitkeep
Normal file
0
src/assets/.gitkeep
Normal file
0
src/assets/fonts/.gitignore
vendored
Normal file
0
src/assets/fonts/.gitignore
vendored
Normal file
3
src/version.json
Normal file
3
src/version.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"version": "0.0.0"
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue