diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index 02b041d..e87829b 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: - name: Build Docker Image run: | - docker build --build-arg VERSION=test --build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") -t threejs-test:test . + docker build -t threejs-test:test . - name: Validate Image run: | @@ -82,14 +82,11 @@ jobs: echo "tag=v$NEW_VERSION" >> $GITHUB_OUTPUT echo "Latest tag: $LATEST_TAG" echo "New version: $NEW_VERSION" - echo "Current VERSION file: $(cat VERSION 2>/dev/null || echo 'not found')" - name: Build Docker Image run: | - VERSION="${{ steps.version.outputs.version }}" - BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - IMAGE_NAME="git.jusemon.com/jusemon/threejs-test:$VERSION" - docker build --build-arg VERSION="$VERSION" --build-arg BUILD_DATE="$BUILD_DATE" -t "$IMAGE_NAME" . + IMAGE_NAME="git.jusemon.com/jusemon/threejs-test:${{ steps.version.outputs.version }}" + docker build -t "$IMAGE_NAME" . echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV - name: Push Docker Image @@ -157,56 +154,6 @@ jobs: echo "TAG_CREATED=true" >> $GITHUB_ENV fi - - name: Update Version Files - run: | - VERSION="${{ steps.version.outputs.version }}" - TAG="${{ steps.version.outputs.tag }}" - - echo "đ Updating version files to: $VERSION" - - # Configure git - git config user.name "forgejo-actions" - git config user.email "forgejo-actions@forgejo.io" - - # Fetch latest changes to avoid conflicts - git fetch origin main || echo "Fetch completed or already up to date" - git checkout main || echo "Already on main" - - # Update VERSION file - echo "$VERSION" > VERSION - - # Update portainer.yml with new version - sed -i "s|\(image: git.jusemon.com/jusemon/threejs-test:\)[0-9.]*|\1$VERSION|" portainer.yml - - # Verify the updates - if grep -q "^$VERSION$" VERSION && grep -q "image: git.jusemon.com/jusemon/threejs-test:$VERSION" portainer.yml; then - echo "â Successfully updated VERSION and portainer.yml to $VERSION" - else - echo "â Failed to update version files" - exit 1 - fi - - # Check if there are changes to commit - if git diff --quiet VERSION portainer.yml; then - echo "âšī¸ No changes to commit (files already up to date)" - else - # Stage and commit with [skip ci] to prevent infinite loop - # Note: Forgejo Actions should respect [skip ci] in commit messages - git add VERSION portainer.yml - git commit -m "chore: update version to $VERSION [skip ci]" || { - echo "â ī¸ Commit failed (may already be committed)" - exit 0 - } - - # Push to main branch - git push origin main || { - echo "â ī¸ Push failed (may need manual intervention or branch protection)" - exit 0 - } - - echo "â Successfully committed and pushed version update to $VERSION" - fi - - name: Job Summary if: success() run: | @@ -236,15 +183,11 @@ jobs: echo "- â ī¸ Tag \`$TAG\` already exists, skipped creation" >> "$SUMMARY_FILE" fi - cat >> "$SUMMARY_FILE" << EOF - - ### Version Files - - â VERSION file updated to \`$VERSION\` - - â portainer.yml updated to \`$VERSION\` + cat >> "$SUMMARY_FILE" << 'EOF' ### Pull Command - \`\`\`bash + ```bash docker pull git.jusemon.com/jusemon/threejs-test:latest - \`\`\` + ``` EOF diff --git a/Dockerfile b/Dockerfile index 59de9f2..38d09b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,5 @@ FROM nginx:alpine -# Accept build argument for version -ARG VERSION=dev -ARG BUILD_DATE=unknown - -# Create version.json file with build information -RUN printf '{"version":"%s","buildDate":"%s"}\n' "${VERSION}" "${BUILD_DATE}" > /usr/share/nginx/html/version.json - # Copy the HTML file COPY index.html /usr/share/nginx/html/index.html diff --git a/VERSION b/VERSION deleted file mode 100644 index ea31cb5..0000000 --- a/VERSION +++ /dev/null @@ -1,2 +0,0 @@ -0.1.5 - diff --git a/docker-compose.yml b/docker-compose.yml index 7a5b902..747f7dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,7 @@ name: threejs-test services: - app: - build: - context: . - args: - VERSION: ${VERSION:-dev} - BUILD_DATE: ${BUILD_DATE:-unknown} + ui: + build: . restart: unless-stopped diff --git a/index.html b/index.html index c509cbe..9a8bfd3 100644 --- a/index.html +++ b/index.html @@ -72,25 +72,10 @@ text-align: center; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); } - #version { - position: absolute; - top: 20px; - right: 20px; - color: rgba(255, 255, 255, 0.7); - font-size: 14px; - text-shadow: 2px 2px 4px rgba(0,0,0,0.5); - z-index: 100; - font-family: 'Courier New', monospace; - } @media (max-width: 768px) { #instructions { font-size: 14px; } - #version { - font-size: 12px; - top: 10px; - right: 10px; - } } @@ -100,8 +85,6 @@
Final Score: 0
@@ -114,27 +97,6 @@