From 12e13bcaee9445faddd798baceae20ecc145bf3a Mon Sep 17 00:00:00 2001 From: Juan Sebastian Montoya Date: Tue, 6 Jan 2026 14:16:25 -0500 Subject: [PATCH 1/2] feat: add portainer deploy config --- portainer.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 portainer.yml diff --git a/portainer.yml b/portainer.yml new file mode 100644 index 0000000..8295a7a --- /dev/null +++ b/portainer.yml @@ -0,0 +1,11 @@ +name: slime + +services: + app: + image: git.jusemon.com/jusemon/slime:0.1.0 + restart: unless-stopped + +networks: + default: + name: default-network + external: true \ No newline at end of file -- 2.49.1 From 5956220a2bb36704bfe79e8d42a50bab1b41c898 Mon Sep 17 00:00:00 2001 From: Juan Sebastian Montoya Date: Tue, 6 Jan 2026 14:25:16 -0500 Subject: [PATCH 2/2] feat: improve image naming --- .forgejo/release-template.md | 2 +- .forgejo/workflows/publish-and-deploy.yaml | 35 ++++++++++++++-------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.forgejo/release-template.md b/.forgejo/release-template.md index d1c2326..1cdf9f3 100644 --- a/.forgejo/release-template.md +++ b/.forgejo/release-template.md @@ -19,6 +19,6 @@ docker pull {{IMAGE_NAME}} The image is also available as `latest`: ``` -docker pull git.jusemon.com/jusemon/threejs-test:latest +docker pull {{IMAGE_BASE}}:latest ``` diff --git a/.forgejo/workflows/publish-and-deploy.yaml b/.forgejo/workflows/publish-and-deploy.yaml index 01c787b..2527d3d 100644 --- a/.forgejo/workflows/publish-and-deploy.yaml +++ b/.forgejo/workflows/publish-and-deploy.yaml @@ -5,6 +5,10 @@ on: branches: - main +env: + REGISTRY: git.jusemon.com + IMAGE_BASE: git.jusemon.com/${{ github.repository }} + jobs: publish: name: Publish to Registry @@ -18,7 +22,7 @@ jobs: - name: Login to Registry run: | - echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.jusemon.com -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin + echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin - name: Determine Version id: version @@ -120,17 +124,21 @@ jobs: git fetch origin main || echo "Fetch completed or already up to date" git checkout main || echo "Already on main" + # Update version in files + IMAGE_BASE="${{ env.IMAGE_BASE }}" + # 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 + # Using a generic match for the image line to be robust against name changes + sed -i "s|image: .*|image: $IMAGE_BASE:$VERSION|g" portainer.yml # Verify the updates - if grep -q "^$VERSION$" VERSION && grep -q "image: git.jusemon.com/jusemon/threejs-test:$VERSION" portainer.yml; then + if grep -q "^$VERSION$" VERSION && grep -q "image: $IMAGE_BASE:$VERSION" portainer.yml; then echo "✅ Successfully updated VERSION and portainer.yml to $VERSION" else - echo "❌ Failed to update version files" + echo "❌ Failed to update version files (Expected Image: $IMAGE_BASE:$VERSION)" exit 1 fi @@ -163,25 +171,25 @@ jobs: 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" + IMAGE_NAME="${{ env.IMAGE_BASE }}:$VERSION" docker build --build-arg VERSION="$VERSION" --build-arg BUILD_DATE="$BUILD_DATE" -t "$IMAGE_NAME" . echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV - name: Push Docker Image run: | - IMAGE_NAME="git.jusemon.com/jusemon/threejs-test:${{ steps.version.outputs.version }}" + IMAGE_NAME="${{ env.IMAGE_BASE }}:${{ steps.version.outputs.version }}" docker push "$IMAGE_NAME" # Also tag as 'latest' for main branch - docker tag "$IMAGE_NAME" "git.jusemon.com/jusemon/threejs-test:latest" - docker push "git.jusemon.com/jusemon/threejs-test:latest" + docker tag "$IMAGE_NAME" "${{ env.IMAGE_BASE }}:latest" + docker push "${{ env.IMAGE_BASE }}:latest" - name: Generate Release Notes id: release_notes run: | VERSION="${{ steps.version.outputs.version }}" TAG="${{ steps.version.outputs.tag }}" - IMAGE_NAME="git.jusemon.com/jusemon/threejs-test:$VERSION" + IMAGE_NAME="${{ env.IMAGE_BASE }}:$VERSION" # Use the version update commit hash (which has the correct version in files) COMMIT_HASH="${VERSION_COMMIT_HASH:-$(git rev-parse HEAD)}" COMMIT_SHORT=$(git rev-parse --short "$COMMIT_HASH") @@ -210,9 +218,11 @@ jobs: # Replace placeholders in template # Handle COMMITS separately due to multi-line content that can break sed + IMAGE_BASE="${{ env.IMAGE_BASE }}" # First, replace all single-line placeholders sed -e "s|{{VERSION}}|$VERSION|g" \ -e "s|{{IMAGE_NAME}}|$IMAGE_NAME|g" \ + -e "s|{{IMAGE_BASE}}|$IMAGE_BASE|g" \ -e "s|{{COMMIT_HASH}}|$COMMIT_HASH|g" \ -e "s|{{COMMIT_SHORT}}|$COMMIT_SHORT|g" \ -e "s|{{BUILD_DATE}}|$BUILD_DATE|g" \ @@ -264,7 +274,8 @@ jobs: SUMMARY_FILE="${FORGEJO_STEP_SUMMARY:-/dev/stdout}" VERSION="${{ steps.version.outputs.version }}" TAG="${{ steps.version.outputs.tag }}" - IMAGE_NAME="git.jusemon.com/jusemon/threejs-test:$VERSION" + IMAGE_BASE="${{ env.IMAGE_BASE }}" + IMAGE_NAME="$IMAGE_BASE:$VERSION" TAG_STATUS="${TAG_CREATED:-false}" cat >> "$SUMMARY_FILE" << EOF @@ -276,7 +287,7 @@ jobs: ### Published Images - ✅ \`$IMAGE_NAME\` - - ✅ \`git.jusemon.com/jusemon/threejs-test:latest\` + - ✅ \`$IMAGE_BASE:latest\` ### Git Tag EOF @@ -295,7 +306,7 @@ jobs: ### Pull Command \`\`\`bash - docker pull git.jusemon.com/jusemon/threejs-test:latest + docker pull ${{ env.IMAGE_BASE }}:latest \`\`\` EOF cat "$SUMMARY_FILE" -- 2.49.1