From de0c2eced09f0d4e84e3956756d5d10a9c57784a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Fri, 12 Jun 2026 17:24:16 +0200 Subject: [PATCH 1/2] Install Playwright browsers in CI test jobs The e2e tests launch chromium, but uv sync only installs the playwright package, not the browser binaries, so CI failed with "Executable doesn't exist" for the headless shell. Co-Authored-By: Claude Fable 5 --- .gitea/workflows/build.yml | 3 +++ .github/workflows/build-docker.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index f81b099..4683dc7 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -19,6 +19,9 @@ jobs: - name: Install dependencies run: uv sync --frozen + - name: Install Playwright browsers + run: uv run playwright install --with-deps chromium + - name: Run Migrations run: uv run python manage.py migrate diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index b33abe8..10530f8 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -19,6 +19,9 @@ jobs: - name: Install dependencies run: uv sync --frozen + - name: Install Playwright browsers + run: uv run playwright install --with-deps chromium + - name: Run Migrations run: uv run python manage.py migrate -- 2.52.0 From f79ec7b454b4833f1704916b8f402f8dcf52b0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Fri, 12 Jun 2026 17:45:35 +0200 Subject: [PATCH 2/2] Comment staging URL on the open PR after deployment Looks up the open PR for the pushed branch via the Gitea API using the workflow token and posts the staging URL once (skips if the same comment already exists). Co-Authored-By: Claude Fable 5 --- .gitea/workflows/staging.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.gitea/workflows/staging.yml b/.gitea/workflows/staging.yml index 112e23e..a54ce17 100644 --- a/.gitea/workflows/staging.yml +++ b/.gitea/workflows/staging.yml @@ -44,6 +44,29 @@ jobs: - name: Summary run: echo "Deployed to https://${HOST}" >> "$GITHUB_STEP_SUMMARY" + - name: Comment staging URL on PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + auth="Authorization: token ${GITHUB_TOKEN}" + api="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}" + pr=$(curl -fsS -H "$auth" "${api}/pulls?state=open&limit=50" \ + | jq -r --arg branch "$BRANCH" '.[] | select(.head.ref == $branch) | .number' | head -n1) + if [ -z "$pr" ]; then + echo "No open PR for branch '${BRANCH}', skipping comment" + exit 0 + fi + body="Staging deployment: https://${HOST}" + if curl -fsS -H "$auth" "${api}/issues/${pr}/comments" \ + | jq -e --arg body "$body" 'any(.[]; .body == $body)' >/dev/null; then + echo "Staging URL already commented on PR #${pr}" + exit 0 + fi + curl -fsS -X POST -H "$auth" -H 'Content-Type: application/json' \ + -d "$(jq -n --arg body "$body" '{body: $body}')" \ + "${api}/issues/${pr}/comments" >/dev/null + echo "Commented staging URL on PR #${pr}" + teardown: if: github.event_name == 'delete' && github.event.ref_type == 'branch' runs-on: ubuntu-latest -- 2.52.0