refactor: change how hashes work

This commit is contained in:
zk
2026-05-16 13:42:22 +00:00
parent 9f2ca87665
commit 0dcd5325b6
14 changed files with 113 additions and 36 deletions
+17 -3
View File
@@ -19,13 +19,24 @@ jobs:
permissions:
contents: read
packages: write
outputs:
image_tag: ${{ steps.revision.outputs.image_tag }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Revision tag (YYYYMMDD-shortsha + full SHA aliases)
id: revision
run: |
set -eu
short=$(git rev-parse --short=7 HEAD)
d=$(TZ=UTC0 git log -1 --format=%cd --date=format:%Y%m%d HEAD)
echo "image_tag=${d}-${short}" >> "$GITHUB_OUTPUT"
- name: Log in to GHCR
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
@@ -48,11 +59,12 @@ jobs:
provenance: true
sbom: true
tags: |
ghcr.io/zkldi/tachi-ghbot:${{ steps.revision.outputs.image_tag }}
ghcr.io/zkldi/tachi-ghbot:${{ github.sha }}
ghcr.io/zkldi/tachi-ghbot:main
ghcr.io/zkldi/tachi-ghbot:latest
build-args: |
COMMIT_HASH=${{ github.sha }}
GIT_REVISION=${{ github.sha }}
BUILD_TIME=${{ steps.build_time.outputs.value }}
cache-from: type=gha,scope=${{ github.ref_name }}-github-bot
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-github-bot
@@ -67,10 +79,12 @@ jobs:
env:
GH_TOKEN: ${{ secrets.DEPLOY_DISPATCH_TOKEN }}
SHA: ${{ github.sha }}
IMAGE_TAG: ${{ needs.docker-push.outputs.image_tag }}
run: |
gh api repos/zkldi/tachi-deploy/dispatches \
-f event_type=deploy \
-F "client_payload[app]=ghbot" \
-F "client_payload[dest]=-" \
-F "client_payload[sha]=${SHA}"
echo "::notice::Dispatched ghbot ${SHA} — logs: https://github.com/zkldi/tachi-deploy/actions/workflows/deploy.yml"
-F "client_payload[sha]=${SHA}" \
-F "client_payload[image_tag]=${IMAGE_TAG}"
echo "::notice::Dispatched ghbot ${IMAGE_TAG} (${SHA}) — logs: https://github.com/zkldi/tachi-deploy/actions/workflows/deploy.yml"