diff --git a/dashboard-sqdc/.gitea/workflows/README.md b/.gitea/workflows/README.md similarity index 93% rename from dashboard-sqdc/.gitea/workflows/README.md rename to .gitea/workflows/README.md index 42c5a96..af2c243 100644 --- a/dashboard-sqdc/.gitea/workflows/README.md +++ b/.gitea/workflows/README.md @@ -6,8 +6,8 @@ This directory contains the Gitea Actions workflow for building and deploying th ### Triggers -- **Push** to `main` or `dashboard` branches -- **Pull Request** to `main` or `dashboard` branches +- **Push** to any branch +- **Pull Request** to any branch ### Jobs @@ -33,7 +33,7 @@ Runs on every push and pull request. #### 2. Deploy Job -Runs only on push to `main` or `dashboard` branches (not on PRs). +Runs on push to any branch (not on PRs). **Steps:** 1. Checkout code @@ -77,7 +77,7 @@ Configure these in Gitea repository settings: - Pushes image to registry - **Does not deploy** to Kubernetes -### On Push to main/dashboard +### On Push to any branch - Builds and tests the code - Pushes image to registry @@ -192,10 +192,14 @@ git commit -m "docs: Update README [skip ci]" ### Change Deployment Conditions -Edit the `if` condition in deploy job: +Edit the `if` condition in deploy job to deploy only on specific branches: ```yaml -if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dashboard' +# Deploy on any push +if: github.event_name == 'push' + +# Or deploy only on specific branches +if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/production' ``` ### Add Slack/Email Notifications diff --git a/dashboard-sqdc/.gitea/workflows/build-deploy.yml b/.gitea/workflows/build-deploy.yml similarity index 95% rename from dashboard-sqdc/.gitea/workflows/build-deploy.yml rename to .gitea/workflows/build-deploy.yml index 0dbb408..16c02e6 100644 --- a/dashboard-sqdc/.gitea/workflows/build-deploy.yml +++ b/.gitea/workflows/build-deploy.yml @@ -3,12 +3,10 @@ name: Build and Deploy SQDC Dashboard on: push: branches: - - main - - dashboard + - '**' pull_request: branches: - - main - - dashboard + - '**' jobs: build: @@ -51,7 +49,7 @@ jobs: name: Deploy to Kubernetes runs-on: ubuntu-latest needs: build - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dashboard' + if: github.event_name == 'push' steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/dashboard-sqdc/DEPLOYMENT.md b/dashboard-sqdc/DEPLOYMENT.md index 35c4af3..d4f7c51 100644 --- a/dashboard-sqdc/DEPLOYMENT.md +++ b/dashboard-sqdc/DEPLOYMENT.md @@ -202,8 +202,8 @@ In your Gitea repository, add the following secrets: The workflow file is already created at `.gitea/workflows/build-deploy.yml` **Workflow triggers:** -- Push to `main` or `dashboard` branch -- Pull requests to `main` or `dashboard` branch +- Push to any branch +- Pull requests to any branch **Workflow steps:** 1. Build - Runs tests, builds Docker image, and pushes to container registry