Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28a381ffb3 | ||
|
|
546d629d36 | ||
|
|
1ff73f8b20 |
No files matched your search
+12
-5
@@ -36,15 +36,22 @@ jobs:
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
# Downloads only, no target/: caching target/ through the cargo-
|
||||
# restore prefix saved every stale artifact back, the cache reached
|
||||
# 1.2 GB and run #40 filled the shared runner's disk. Dependencies are
|
||||
# recompiled each run instead. (Swatinem/rust-cache would keep them,
|
||||
# but the runner resolves actions from git.app.ygg and it isn't
|
||||
# mirrored there.) The key has a v2 prefix so no old cache with target/
|
||||
# in it is restored.
|
||||
- name: Cache cargo
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: cargo-${{ hashFiles('Cargo.lock') }}
|
||||
restore-keys: cargo-
|
||||
~/.cargo/registry/index
|
||||
~/.cargo/registry/cache
|
||||
~/.cargo/git/db
|
||||
key: cargo-v2-${{ hashFiles('Cargo.lock') }}
|
||||
restore-keys: cargo-v2-
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt --check
|
||||
|
||||
@@ -30,3 +30,30 @@ jobs:
|
||||
DIGEST: ${{ steps.image.outputs.digest }}
|
||||
run: |
|
||||
printf 'tags: %s\ndigest: %s\n' "$TAGS" "$DIGEST"
|
||||
|
||||
# Renovate in ygg/deployments otherwise only runs at 03:00 UTC, so
|
||||
# start it now to open the deploy PR within minutes. The job token
|
||||
# can't dispatch in another repo, so this needs a token with
|
||||
# write:repository from an account with write access to ygg/deployments.
|
||||
# The image is already pushed: anything going wrong here is a warning,
|
||||
# never a failed release.
|
||||
- name: Start Renovate in ygg/deployments
|
||||
env:
|
||||
TOKEN: ${{ secrets.DEPLOYMENTS_DISPATCH_TOKEN }}
|
||||
API: ${{ gitea.api_url }}
|
||||
run: |
|
||||
if [ -z "$TOKEN" ]; then
|
||||
echo "::warning::DEPLOYMENTS_DISPATCH_TOKEN is not set; Renovate opens the deploy PR at its next 03:00 UTC run"
|
||||
exit 0
|
||||
fi
|
||||
body=$(mktemp)
|
||||
code=$(curl -sS --max-time 30 -o "$body" -w '%{http_code}' -X POST \
|
||||
-H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
|
||||
-d '{"ref":"main"}' \
|
||||
"$API/repos/ygg/deployments/actions/workflows/renovate.yml/dispatches") || code="curl failed"
|
||||
if [ "$code" = 204 ]; then
|
||||
echo "Renovate started: https://git.app.ygg/ygg/deployments/actions?workflow=renovate.yml"
|
||||
else
|
||||
echo "::warning::Could not start Renovate in ygg/deployments ($code): $(head -c 300 "$body")"
|
||||
fi
|
||||
rm -f "$body"
|
||||
Reference in new issue
Block a user