mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-01 07:46:55 +00:00
try and push images to atcr.io
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user