Skip to content

Commit dd3dc4f

Browse files
Merge pull request #21 from hhftechnology/traefik-int
Traefik API Integration
2 parents bdba91e + 66c267f commit dd3dc4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+8693
-4336
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/main.yml

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ name: Build and Push Docker Image
33
on:
44
push:
55
branches:
6-
- main
7-
- master
8-
- dev
6+
- traefik-int
97
paths:
108
- 'Dockerfile'
119
- 'go.mod'
@@ -19,9 +17,6 @@ on:
1917
- 'models/**'
2018
- 'services/**'
2119
- 'ui/**'
22-
23-
tags:
24-
- 'v*'
2520
workflow_dispatch:
2621

2722
env:
@@ -53,57 +48,23 @@ jobs:
5348
username: ${{ secrets.DOCKERHUB_USERNAME }}
5449
password: ${{ secrets.DOCKERHUB_TOKEN }}
5550

56-
# Get current date for image tags
57-
- name: Get current date
58-
id: date
59-
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
60-
6151
# Prepare tags based on branch and version
6252
- name: Prepare Docker tags
6353
id: docker_tags
6454
run: |
6555
TAGS=""
66-
67-
# Add branch-specific tags
68-
if [[ "${{ github.ref_name }}" == "main" || "${{ github.ref_name }}" == "master" ]]; then
69-
# For main/master branch, add latest tag
70-
TAGS="$TAGS ${{ env.DOCKERHUB_IMAGE_NAME }}:latest"
71-
elif [[ "${{ github.ref_name }}" == "dev" ]]; then
72-
# For dev branch
73-
TAGS="$TAGS ${{ env.DOCKERHUB_IMAGE_NAME }}:dev"
74-
elif [[ "${{ github.ref_type }}" == "branch" ]]; then
75-
# For other branches
76-
TAGS="$TAGS ${{ env.DOCKERHUB_IMAGE_NAME }}:${{ github.ref_name }}"
77-
fi
78-
79-
# Add sha tag for all branches
80-
if [[ "${{ github.ref_type }}" == "branch" ]]; then
81-
TAGS="$TAGS,${{ env.DOCKERHUB_IMAGE_NAME }}:sha-${GITHUB_SHA::7}"
82-
fi
83-
84-
# Add version tag for tagged releases
85-
if [[ "${{ github.ref_type }}" == "tag" && "${{ github.ref }}" == refs/tags/v* ]]; then
86-
VERSION="${{ github.ref_name }}"
87-
88-
# Add full version tag
89-
TAGS="$TAGS,${{ env.DOCKERHUB_IMAGE_NAME }}:$VERSION"
56+
if [[ "${{ github.ref_type }}" == "branch" && "${{ github.ref_name }}" == "traefik-int" ]]; then
57+
TAGS="${{ env.DOCKERHUB_IMAGE_NAME }}:traefik-int"
9058
fi
91-
92-
# Add date tag for all builds
93-
TAGS="$TAGS,${{ env.DOCKERHUB_IMAGE_NAME }}:${{ steps.date.outputs.date }}"
94-
95-
# Remove leading space or comma if present
96-
TAGS=$(echo "$TAGS" | sed 's/^[ ,]*//')
97-
9859
echo "tags=$TAGS" >> $GITHUB_OUTPUT
9960
echo "Docker tags: $TAGS"
10061
10162
- name: Build and push
10263
uses: docker/build-push-action@v5
10364
with:
10465
context: .
105-
push: true
66+
push: ${{ steps.docker_tags.outputs.tags != '' }} # IMPORTANT: Only push if tags were generated
10667
platforms: linux/amd64,linux/arm64
10768
tags: ${{ steps.docker_tags.outputs.tags }}
10869
cache-from: type=gha
109-
cache-to: type=gha,mode=max
70+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ COPY ui/public/ ./public/
1717

1818
# Copy *specific* source files and directories from host's ui/src into container's /app/src
1919
COPY ui/src/styles ./src/styles
20+
COPY ui/src/components ./src/components
21+
COPY ui/src/contexts ./src/contexts
22+
COPY ui/src/services ./src/services
2023
COPY ui/src/App.js ./src/App.js
2124
COPY ui/src/index.js ./src/index.js
2225

0 commit comments

Comments
 (0)