From b4fc4fc9559a8afa858fe9ab4d525ba7dfea8159 Mon Sep 17 00:00:00 2001 From: Ryan Kegel Date: Sun, 26 Apr 2026 22:41:14 -0400 Subject: [PATCH] feat: add workflow for promoting master to production with testing and deployment steps --- .gitea/workflows/promote-master.yaml | 26 ++++++++++++++++++++------ frontend/e2e/.auth/user.json | 12 ++++++------ frontend/test-results/.last-run.json | 2 +- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/promote-master.yaml b/.gitea/workflows/promote-master.yaml index b96395c..d03c288 100644 --- a/.gitea/workflows/promote-master.yaml +++ b/.gitea/workflows/promote-master.yaml @@ -31,7 +31,7 @@ on: require_manual_approval: description: "Require approval token for deploy job" required: true - default: "true" + default: "false" approval_token: description: "Approval token value when manual approval is required" required: false @@ -192,13 +192,27 @@ jobs: script: | set -euo pipefail - cd /opt - if [ -d "chore/.git" ]; then - cd chore + repo_dir="${{ secrets.DEPLOY_PROD_PATH }}" + if [ -z "$repo_dir" ]; then + repo_dir="$HOME/chore" + fi + + repo_parent=$(dirname "$repo_dir") + if [ ! -d "$repo_parent" ]; then + mkdir -p "$repo_parent" + fi + if [ ! -w "$repo_parent" ]; then + echo "Deploy user $(whoami) cannot write to ${repo_parent}." + echo "Set DEPLOY_PROD_PATH to a writable location or grant write access before rerunning promotion." + exit 1 + fi + + if [ -d "$repo_dir/.git" ]; then + cd "$repo_dir" git fetch --all --tags else - git clone --branch "${{ needs.prepare.outputs.target_ref }}" https://git.ryankegel.com/ryan/chore.git chore - cd chore + git clone --branch "${{ needs.prepare.outputs.target_ref }}" https://git.ryankegel.com/ryan/chore.git "$repo_dir" + cd "$repo_dir" fi git checkout "${{ needs.prepare.outputs.target_ref }}" diff --git a/frontend/e2e/.auth/user.json b/frontend/e2e/.auth/user.json index c5fb6cd..3e2b5ab 100644 --- a/frontend/e2e/.auth/user.json +++ b/frontend/e2e/.auth/user.json @@ -2,20 +2,20 @@ "cookies": [ { "name": "refresh_token", - "value": "caYfAayTk40YWkRvN82a9_mGQ_-wXy6JdBBaD_UhLcQ", + "value": "mqtPPFKJGGfFly1i0VW1MtJUvgIpb7LlWUEpFLn1hGc", "domain": "localhost", "path": "/api/auth", - "expires": 1785003956.884209, + "expires": 1785022348.96348, "httpOnly": true, "secure": true, "sameSite": "Strict" }, { "name": "access_token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImUyZUB0ZXN0LmNvbSIsInVzZXJfaWQiOiI3YjcxMGU0ZC02ZTExLTRjMjctODllNS1jZTcxNGZhOTgwZTIiLCJ0b2tlbl92ZXJzaW9uIjowLCJleHAiOjE3NzcyMjg4NTZ9.wJCrQ9Y5nbVpqd6yCeCHcpcpGpg4YqavqlsHbU8kDPE", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImUyZUB0ZXN0LmNvbSIsInVzZXJfaWQiOiIzZDJmZmY0OS03MjNhLTRhMmUtYWRhOS1iMTE5N2VhYTI2MDkiLCJ0b2tlbl92ZXJzaW9uIjowLCJleHAiOjE3NzcyNTcxNDh9.g69Lwtay2i0jwEzAbYcRWM2oGoOm-4qpV8YC04X0v-0", "domain": "localhost", "path": "/", - "expires": 1777228856.884169, + "expires": 1777257148.963437, "httpOnly": true, "secure": true, "sameSite": "Lax" @@ -27,11 +27,11 @@ "localStorage": [ { "name": "authSyncEvent", - "value": "{\"type\":\"logout\",\"at\":1777227956772}" + "value": "{\"type\":\"logout\",\"at\":1777246348801}" }, { "name": "parentAuth", - "value": "{\"expiresAt\":1777400757015}" + "value": "{\"expiresAt\":1777419149107}" } ] } diff --git a/frontend/test-results/.last-run.json b/frontend/test-results/.last-run.json index cbcc1fb..344ea9e 100644 --- a/frontend/test-results/.last-run.json +++ b/frontend/test-results/.last-run.json @@ -1,4 +1,4 @@ { - "status": "passed", + "status": "interrupted", "failedTests": [] } \ No newline at end of file