tag
This commit is contained in:
parent
770c41d5e0
commit
1ca02412a9
@ -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
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user