From a2bcc06b79f19f6ec858563c182fb155846c40fa Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Mon, 13 Oct 2025 21:22:21 -0500 Subject: [PATCH] try and push images to atcr.io --- .tangled/workflows/release.yml | 54 +++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/.tangled/workflows/release.yml b/.tangled/workflows/release.yml index 060c5ae..684e0ce 100644 --- a/.tangled/workflows/release.yml +++ b/.tangled/workflows/release.yml @@ -2,7 +2,7 @@ # Triggers on version tags and builds cross-platform binaries using GoReleaser when: - - event: ["manual"] + - event: ["push", "manual"] # TODO: Trigger only on version tags (v1.0.0, v2.1.3, etc.) branch: ["main"] @@ -12,20 +12,54 @@ dependencies: nixpkgs: - git - go - - goreleaser + #- goreleaser + - docker steps: - name: Fetch git tags command: git fetch --tags --force - - name: Checkout latest tag - command: git checkout $(git tag --sort=-version:refname | head -n1) + - name: Checkout tag for current commit + command: | + CURRENT_COMMIT=$(git rev-parse HEAD) + export TAG=$(git tag --points-at $CURRENT_COMMIT --sort=-version:refname | head -n1) + if [ -z "$TAG" ]; then + echo "Error: No tag found for commit $CURRENT_COMMIT" + exit 1 + fi + echo "Found tag $TAG for commit $CURRENT_COMMIT" + echo "TAG=$TAG" >> $GITHUB_ENV || true + git checkout $TAG - - name: Tidy Go modules - command: go mod tidy + - name: Login to atcr.io + command: docker login atcr.io -u evan.jarrett.net -p ${APP_PASSWORD} - - name: Install Goat - command: go install github.com/bluesky-social/goat@latest + - name: Build AppView Docker image + command: | + TAG=$(git describe --tags --exact-match 2>/dev/null || git tag --points-at HEAD | head -n1) + docker build -f Dockerfile.appview -t atcr.io/evan.jarrett.net/atcr-appview:${TAG} . - - name: Run GoReleaser - command: goreleaser release --clean + - name: Build Hold Docker image + command: | + TAG=$(git describe --tags --exact-match 2>/dev/null || git tag --points-at HEAD | head -n1) + docker build -f Dockerfile.hold -t atcr.io/evan.jarrett.net/atcr-hold:${TAG} . + + - name: Push AppView Docker image + command: | + TAG=$(git describe --tags --exact-match 2>/dev/null || git tag --points-at HEAD | head -n1) + docker push atcr.io/evan.jarrett.net/atcr-appview:${TAG} + + - name: Push Hold Docker image + command: | + TAG=$(git describe --tags --exact-match 2>/dev/null || git tag --points-at HEAD | head -n1) + docker push atcr.io/evan.jarrett.net/atcr-hold:${TAG} + + # disable for now + # - name: Tidy Go modules + # command: go mod tidy + + # - name: Install Goat + # command: go install github.com/bluesky-social/goat@latest + + # - name: Run GoReleaser + # command: goreleaser release --clean