Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Allow automated pushes to change only image tags
- name: Allow automated pushes to change only image tags and the enabled switch
if: github.event_name == 'push' && endsWith(github.actor, '[bot]')
run: |
set -euo pipefail
Expand All @@ -49,9 +49,9 @@ jobs:
exit 1
fi
files="$(git diff --name-only "$BEFORE" HEAD | grep -Ev '^deploy/[a-z0-9-]+/values$' || true)"
lines="$(git diff -U0 "$BEFORE" HEAD -- 'deploy/*/values' | grep -E '^[+-]' | grep -Ev '^(\+\+\+|---) ' | grep -Ev '^[+-]IMAGE_TAG=sha-[0-9a-f]{7,40}$' || true)"
lines="$(git diff -U0 "$BEFORE" HEAD -- 'deploy/*/values' | grep -E '^[+-]' | grep -Ev '^(\+\+\+|---) ' | grep -Ev '^[+-](IMAGE_TAG=sha-[0-9a-f]{7,40}|ENABLED=false)$' || true)"
if [ -n "$files" ] || [ -n "$lines" ]; then
echo "::error::${GITHUB_ACTOR} may change only IMAGE_TAG lines in deploy/*/values; refusing to deploy:"
echo "::error::${GITHUB_ACTOR} may change only IMAGE_TAG and ENABLED=false lines in deploy/*/values; refusing to deploy:"
printf '%s\n' "$files" "$lines"
exit 1
fi
Expand Down
2 changes: 2 additions & 0 deletions deploy/console/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ services:
SMTP_URL: ${SMTP_URL:-}
ALERTS_EMAIL: ${ALERTS_EMAIL:-}
ALERTS_FROM: ${ALERTS_FROM:-}
PLATFORM_APP_CLIENT_ID: ${PLATFORM_APP_CLIENT_ID:-}
PLATFORM_APP_PRIVATE_KEY: ${PLATFORM_APP_PRIVATE_KEY:-}
privileged: true
pid: host
volumes: [/var/run/docker.sock:/var/run/docker.sock, data:/data, logs:/logs]
Expand Down
4 changes: 2 additions & 2 deletions scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def plan():
for slug in chosen:
registered = entry(slug)
kind = registered["deploy"]["kind"] if registered else None
if not (DEPLOY / slug).is_dir():
if not (DEPLOY / slug).is_dir() or values(slug).get("ENABLED") == "false":
if kind == "compose":
down.append(slug)
elif kind == "compose" and compose_project(slug):
Expand Down Expand Up @@ -239,7 +239,7 @@ def check():
kind = registered["deploy"]["kind"] if registered else None
try:
if kind == "pages":
problems.extend(f"deploy/{slug}/values: {name} is not used by a Pages site" for name in set(values(slug)) - {"IMAGE_TAG"})
problems.extend(f"deploy/{slug}/values: {name} is not used by a Pages site" for name in set(values(slug)) - {"IMAGE_TAG", "ENABLED"})
elif kind == "compose" and compose_project(slug):
route(slug, render(slug)[0])
else:
Expand Down
Loading