work on deploy to flyer-crawler.projectium.com
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Has been cancelled

This commit is contained in:
2025-11-10 09:30:01 -08:00
parent f6ce97019e
commit b7db2853b5
2 changed files with 75 additions and 1 deletions

View File

@@ -0,0 +1,74 @@
# FILE: .gitea/workflows/deploy.yml
#
# note to AI - the order in this file matters - also, minor changes to this file can have big impacts and is easy to break
name: Deploy to Web Server flyer-crawler.projectium.com
on:
push:
branches:
- main # This pipeline runs only on a push to the 'main' branch.
jobs:
deploy:
runs-on: local-ubuntu-runner # This job runs on your self-hosted Gitea runner.
# Environment variables are used to pass secrets and configuration to the steps below.
# These must be configured as secrets in your Gitea repository settings.
env:
# Public keys needed for the React build process.
REACT_APP_SUPABASE_URL: ${{ secrets.REACT_APP_SUPABASE_URL }}
REACT_APP_SUPABASE_ANON_KEY: ${{ secrets.REACT_APP_SUPABASE_ANON_KEY }}
# Supabase token for non-interactive CLI authentication.
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
# The project ID for linking the Supabase CLI.
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
# Add this NEW STEP FOR DEBUGGING
- name: Show Git REF
run: |
echo "Gitea ref: ${{ gitea.ref }}"
echo "Gitea ref_name: ${{ gitea.ref_name }}" # often more useful (e.g., 'main' or 'my-feature-branch')
echo "Gitea ref_type: ${{ gitea.ref_type }}" # 'branch' or 'tag'
echo "Gitea SHA: ${{ gitea.sha }}"
echo "Triggering actor: ${{ gitea.actor }}"
echo "Repository: ${{ gitea.repository }}"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm' # Cache npm dependencies to speed up subsequent builds.
cache-dependency-path: 'package-lock.json'
- name: Install Dependencies
run: npm ci # 'ci' is faster and safer for CI/CD than 'install'.
# --- Backend Deployment ---
- name: Deploy Supabase Edge Functions
run: |
echo "Deploying Edge Functions to Supabase project: ${{ env.SUPABASE_PROJECT_ID }}"
# The SUPABASE_ACCESS_TOKEN env var handles login automatically.
# The --project-ref flag links the CLI to your project.
# We deploy each function as per the README instructions.
npx supabase functions deploy system-check --project-ref ${{ env.SUPABASE_PROJECT_ID }}
npx supabase functions deploy delete-user --project-ref ${{ env.SUPABASE_PROJECT_ID }}
npx supabase functions deploy seed-database --project-ref ${{ env.SUPABASE_PROJECT_ID }}
# --- Frontend Deployment ---
- name: Build React Application
run: npm run build # This creates the 'build' directory with static files.
# The REACT_APP_* env vars are automatically used by Create React App here.
- name: Deploy Frontend via Local Copy
run: |
echo "Deploying frontend files to local web server path..."
# Ensure the destination directory exists before copying.
mkdir -p "/var/www/flyer-crawler.projectium.com"
# Use rsync to efficiently copy files from the build output to the web server directory.
# The '--delete' flag removes old files from the destination, ensuring a clean deployment.
rsync -avz --delete build/ "/var/www/flyer-crawler.projectium.com"
echo "Local deployment complete."

View File

@@ -5,4 +5,4 @@ First, some rules:
4) add comments when you can, as that will help ensure ideas persist into the app
5) Before you make any destructive changes, you must stop and ask for my explicit confirmation. A 'destructive change' includes: Deleting more than 20 lines of code at once. Deleting an entire file. Deleting a major, self-contained block of code like a schema definition, a component, or a large function. When you identify a need for such a change, you must first state exactly what you intend to delete and why. Then, you must wait for me to reply with 'Confirm' or 'Proceed' before you generate the code."
6) Operate in 'conservative mode'. Your primary task is to add or modify code. Do not remove any existing functions, components, files, or large code blocks unless I have explicitly and unambiguously instructed you to do so in the current prompt. If you believe a piece of code is redundant or should be refactored, you may suggest it, but you must not perform the deletion or move yourself without my prior instruction.
7) When you are refactoring by moving a significant amount of code from an existing file to a new file, you are required to provide the complete contents of both files in your response: the newly created file and the original file from which the code was removed. Do not just show me the new file and an empty old file.
7) When you are refactoring by moving a significant amount of code from an existing file to a new file, you are required to provide the complete contents of both files in your response: the newly created file and the original file from which the code was removed. Do not just show me the new file and an empty old file.