From 158c7f2786da52e28a204557db17f492cf18f230 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 10 Jun 2026 19:55:53 -0400 Subject: [PATCH] automated update: 2026-06-10 19:55:53 --- .github/workflows/docker-publish.yml | 31 ++++++++++++++++++++++++++++ build.sh | 30 +++++++-------------------- 2 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..174cd21 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,31 @@ +name: Publish Docker Image + +on: + push: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ghcr.io/sudolulo/if-curator-headless:latest + diff --git a/build.sh b/build.sh index c224d5f..e2daf0b 100755 --- a/build.sh +++ b/build.sh @@ -2,35 +2,19 @@ set -e # --- Configuration --- -IMAGE_NAME="ghcr.io/sudolulo/if-curator-headless" -TAG="latest" COMMIT_MSG="automated update: $(date '+%Y-%m-%d %H:%M:%S')" -# --- 1. Git Commit & Push --- -echo "💾 Committing changes to Git..." +# --- Git Sync --- +echo "💾 Committing and pushing changes to GitHub..." + git add . + +# Only proceed if there are actual changes to commit if ! git diff-index --quiet HEAD --; then git commit -m "$COMMIT_MSG" git push - echo "✅ Changes pushed to GitHub." + echo "✅ Changes pushed. GitHub Actions will now build and deploy the image." else - echo "â„šī¸ No changes to commit." + echo "â„šī¸ No changes detected; nothing to push." fi -# --- 2. Build Docker --- -echo "🔧 Building image (no cache)..." -docker build --no-cache -t ${IMAGE_NAME}:${TAG} . - -# --- 3. Push to GHCR --- -echo "📤 Pushing to GHCR..." -docker push ${IMAGE_NAME}:${TAG} - -# --- 4. Success UI --- -echo "" -echo " ╔══════════════════════════════════════════════════╗" -echo " ║ ║" -echo " ║ ✅ GIT & DOCKER DEPLOY COMPLETE ║" -echo " ║ ║" -echo " ╚══════════════════════════════════════════════════╝" -echo "" -