From dc72a99f4d741e23fafc9f7a17ff5776524ffef0 Mon Sep 17 00:00:00 2001 From: Eric Gullickson <16152721+ericgullickson@users.noreply.github.com> Date: Tue, 30 Dec 2025 10:36:23 -0600 Subject: [PATCH] fix: Update configs for Production deployment --- .gitea/workflows/production.yaml | 46 ++++++++++++++------------------ 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/.gitea/workflows/production.yaml b/.gitea/workflows/production.yaml index b5b60fd..d23788b 100644 --- a/.gitea/workflows/production.yaml +++ b/.gitea/workflows/production.yaml @@ -84,22 +84,27 @@ jobs: BACKEND_IMAGE: ${{ needs.validate.outputs.backend_image }} FRONTEND_IMAGE: ${{ needs.validate.outputs.frontend_image }} steps: - - name: Checkout scripts only + - name: Checkout scripts and config uses: actions/checkout@v4 with: - sparse-checkout: scripts/ + sparse-checkout: | + scripts/ + config/ sparse-checkout-cone-mode: true fetch-depth: 1 + - name: Sync config to deploy path + run: | + rsync -av --delete "$GITHUB_WORKSPACE/config/" "$DEPLOY_PATH/config/" + - name: Login to registry run: | echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login -u "${{ secrets.REGISTRY_USER }}" --password-stdin "$REGISTRY" - name: Inject secrets run: | - cd "$DEPLOY_PATH" - chmod +x scripts/inject-secrets.sh - ./scripts/inject-secrets.sh + chmod +x "$GITHUB_WORKSPACE/scripts/inject-secrets.sh" + "$GITHUB_WORKSPACE/scripts/inject-secrets.sh" env: POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }} @@ -135,9 +140,8 @@ jobs: - name: Run health check run: | - cd "$DEPLOY_PATH" - chmod +x scripts/ci/health-check.sh - ./scripts/ci/health-check.sh $TARGET_STACK $HEALTH_CHECK_TIMEOUT + chmod +x "$GITHUB_WORKSPACE/scripts/ci/health-check.sh" + "$GITHUB_WORKSPACE/scripts/ci/health-check.sh" $TARGET_STACK $HEALTH_CHECK_TIMEOUT - name: Start Traefik run: | @@ -157,9 +161,8 @@ jobs: - name: Switch traffic run: | - cd "$DEPLOY_PATH" - chmod +x scripts/ci/switch-traffic.sh - ./scripts/ci/switch-traffic.sh $TARGET_STACK instant + chmod +x "$GITHUB_WORKSPACE/scripts/ci/switch-traffic.sh" + "$GITHUB_WORKSPACE/scripts/ci/switch-traffic.sh" $TARGET_STACK instant - name: Update deployment state run: | @@ -254,17 +257,10 @@ jobs: sparse-checkout-cone-mode: true fetch-depth: 1 - - name: Checkout config - uses: actions/checkout@v4 - with: - sparse-checkout: config/ - sparse-checkout-cone-mode: true - - name: Execute rollback run: | - cd "$DEPLOY_PATH" - chmod +x scripts/ci/auto-rollback.sh - ./scripts/ci/auto-rollback.sh "Production verification failed - automatic rollback" + chmod +x "$GITHUB_WORKSPACE/scripts/ci/auto-rollback.sh" + "$GITHUB_WORKSPACE/scripts/ci/auto-rollback.sh" "Production verification failed - automatic rollback" - name: Update state run: | @@ -292,9 +288,8 @@ jobs: - name: Send success notification run: | - cd "$DEPLOY_PATH" - chmod +x scripts/ci/notify.sh - ./scripts/ci/notify.sh success "Production deployment successful - ${{ inputs.image_tag }} is now live" ${{ inputs.image_tag }} + chmod +x "$GITHUB_WORKSPACE/scripts/ci/notify.sh" + "$GITHUB_WORKSPACE/scripts/ci/notify.sh" success "Production deployment successful - ${{ inputs.image_tag }} is now live" ${{ inputs.image_tag }} env: DEPLOY_NOTIFY_EMAIL: ${{ vars.DEPLOY_NOTIFY_EMAIL }} RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} @@ -317,9 +312,8 @@ jobs: - name: Send failure notification run: | - cd "$DEPLOY_PATH" - chmod +x scripts/ci/notify.sh - ./scripts/ci/notify.sh failure "Production deployment failed for ${{ inputs.image_tag }}" ${{ inputs.image_tag }} + chmod +x "$GITHUB_WORKSPACE/scripts/ci/notify.sh" + "$GITHUB_WORKSPACE/scripts/ci/notify.sh" failure "Production deployment failed for ${{ inputs.image_tag }}" ${{ inputs.image_tag }} env: DEPLOY_NOTIFY_EMAIL: ${{ vars.DEPLOY_NOTIFY_EMAIL }} RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}