Merge pull request 'Promote main to release (domain-sha tag keying)' (#5) from main into release
All checks were successful
secrets-guard / encrypted (push) Successful in 5s
All checks were successful
secrets-guard / encrypted (push) Successful in 5s
This commit is contained in:
commit
46e3163420
5 changed files with 60 additions and 10 deletions
|
|
@ -65,6 +65,12 @@ jobs:
|
||||||
IMAGE_PATH: ${{ github.repository }}/backend
|
IMAGE_PATH: ${{ github.repository }}/backend
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
# fetch-depth 0: the tag is keyed to the LAST COMMIT THAT TOUCHED THIS
|
||||||
|
# DOMAIN, not the branch tip -- in a path-filtered monorepo the tip is
|
||||||
|
# often an unrelated domain's commit, and a depth-1 clone can't see
|
||||||
|
# past it to find the real key.
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Docker CLI
|
- name: Install Docker CLI
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -77,7 +83,13 @@ jobs:
|
||||||
host="${REGISTRY#https://}"; host="${host#http://}"
|
host="${REGISTRY#https://}"; host="${host#http://}"
|
||||||
path="$(printf '%s' "$IMAGE_PATH" | tr '[:upper:]' '[:lower:]')"
|
path="$(printf '%s' "$IMAGE_PATH" | tr '[:upper:]' '[:lower:]')"
|
||||||
ref="$host/$path"
|
ref="$host/$path"
|
||||||
sha_tag="$ref:sha-${GITHUB_SHA:0:12}"
|
# Key the tag to the last commit that touched backend/ -- the SAME key
|
||||||
|
# every backend deploy workflow computes -- so build and deploy always
|
||||||
|
# agree even when the branch tip is another domain's commit. (A tag
|
||||||
|
# keyed to the push tip breaks the moment an infra-only commit lands:
|
||||||
|
# deploys go looking for an image no build ever produced.)
|
||||||
|
domain_sha="$(git log -1 --format=%H -- backend/)"
|
||||||
|
sha_tag="$ref:sha-${domain_sha:0:12}"
|
||||||
echo "host=$host" >> "$GITHUB_OUTPUT"
|
echo "host=$host" >> "$GITHUB_OUTPUT"
|
||||||
echo "sha_tag=$sha_tag" >> "$GITHUB_OUTPUT"
|
echo "sha_tag=$sha_tag" >> "$GITHUB_OUTPUT"
|
||||||
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
|
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,20 @@ jobs:
|
||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
# fetch-depth 0: the tag is keyed to the LAST COMMIT THAT TOUCHED THIS
|
||||||
|
# DOMAIN, not the branch tip -- in a path-filtered monorepo the tip is
|
||||||
|
# often an unrelated domain's commit, and a depth-1 clone can't see
|
||||||
|
# past it to find the real key.
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Compute image tag
|
- name: Compute image tag
|
||||||
id: tag
|
id: tag
|
||||||
# Same 12-hex truncation the beta/prod deploys use -- must match
|
# Keyed to the last commit that touched backend/ -- must match
|
||||||
# backend-build-push.yml's `sha-${GITHUB_SHA:0:12}` tag exactly.
|
# backend-build-push.yml's tag key exactly (see its comment).
|
||||||
run: echo "tag=sha-${GITHUB_SHA:0:12}" >> "$GITHUB_OUTPUT"
|
run: |
|
||||||
|
domain_sha="$(git log -1 --format=%H -- backend/)"
|
||||||
|
echo "tag=sha-${domain_sha:0:12}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Deploy to the LAN dev server
|
- name: Deploy to the LAN dev server
|
||||||
# thermograph-lan is host-native (the runner job runs directly on the
|
# thermograph-lan is host-native (the runner job runs directly on the
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,19 @@ jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- name: Compute image tag
|
- uses: actions/checkout@v4
|
||||||
|
# fetch-depth 0: the tag is keyed to the LAST COMMIT THAT TOUCHED THIS
|
||||||
|
# DOMAIN, not the branch tip -- in a path-filtered monorepo the tip is
|
||||||
|
# often an unrelated domain's commit, and a depth-1 clone can't see
|
||||||
|
# past it to find the real key.
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Compute image tag (last backend-touching commit)
|
||||||
id: tag
|
id: tag
|
||||||
run: echo "tag=sha-${GITHUB_SHA:0:12}" >> "$GITHUB_OUTPUT"
|
run: |
|
||||||
|
domain_sha="$(git log -1 --format=%H -- backend/)"
|
||||||
|
echo "tag=sha-${domain_sha:0:12}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Deploy backend over SSH
|
- name: Deploy backend over SSH
|
||||||
uses: https://github.com/appleboy/ssh-action@v1.2.0
|
uses: https://github.com/appleboy/ssh-action@v1.2.0
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,12 @@ jobs:
|
||||||
IMAGE_PATH: ${{ github.repository }}/frontend
|
IMAGE_PATH: ${{ github.repository }}/frontend
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
# fetch-depth 0: the tag is keyed to the LAST COMMIT THAT TOUCHED THIS
|
||||||
|
# DOMAIN, not the branch tip -- in a path-filtered monorepo the tip is
|
||||||
|
# often an unrelated domain's commit, and a depth-1 clone can't see
|
||||||
|
# past it to find the real key.
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Docker CLI
|
- name: Install Docker CLI
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -77,7 +83,13 @@ jobs:
|
||||||
host="${REGISTRY#https://}"; host="${host#http://}"
|
host="${REGISTRY#https://}"; host="${host#http://}"
|
||||||
path="$(printf '%s' "$IMAGE_PATH" | tr '[:upper:]' '[:lower:]')"
|
path="$(printf '%s' "$IMAGE_PATH" | tr '[:upper:]' '[:lower:]')"
|
||||||
ref="$host/$path"
|
ref="$host/$path"
|
||||||
sha_tag="$ref:sha-${GITHUB_SHA:0:12}"
|
# Key the tag to the last commit that touched frontend/ -- the SAME key
|
||||||
|
# every frontend deploy workflow computes -- so build and deploy always
|
||||||
|
# agree even when the branch tip is another domain's commit. (A tag
|
||||||
|
# keyed to the push tip breaks the moment an infra-only commit lands:
|
||||||
|
# deploys go looking for an image no build ever produced.)
|
||||||
|
domain_sha="$(git log -1 --format=%H -- frontend/)"
|
||||||
|
sha_tag="$ref:sha-${domain_sha:0:12}"
|
||||||
echo "host=$host" >> "$GITHUB_OUTPUT"
|
echo "host=$host" >> "$GITHUB_OUTPUT"
|
||||||
echo "sha_tag=$sha_tag" >> "$GITHUB_OUTPUT"
|
echo "sha_tag=$sha_tag" >> "$GITHUB_OUTPUT"
|
||||||
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
|
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,20 @@ jobs:
|
||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
# fetch-depth 0: the tag is keyed to the LAST COMMIT THAT TOUCHED THIS
|
||||||
|
# DOMAIN, not the branch tip -- in a path-filtered monorepo the tip is
|
||||||
|
# often an unrelated domain's commit, and a depth-1 clone can't see
|
||||||
|
# past it to find the real key.
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Compute image tag
|
- name: Compute image tag
|
||||||
id: tag
|
id: tag
|
||||||
# Same 12-hex truncation the beta/prod deploys use -- must match
|
# Keyed to the last commit that touched frontend/ -- must match
|
||||||
# frontend-build-push.yml's `sha-${GITHUB_SHA:0:12}` tag exactly.
|
# frontend-build-push.yml's tag key exactly (see its comment).
|
||||||
run: echo "tag=sha-${GITHUB_SHA:0:12}" >> "$GITHUB_OUTPUT"
|
run: |
|
||||||
|
domain_sha="$(git log -1 --format=%H -- frontend/)"
|
||||||
|
echo "tag=sha-${domain_sha:0:12}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Deploy to the LAN dev server
|
- name: Deploy to the LAN dev server
|
||||||
# thermograph-lan is host-native (the runner job runs directly on the
|
# thermograph-lan is host-native (the runner job runs directly on the
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue