Skip to content

Commit eefd61d

Browse files
authored
Added deployment trigger (#85)
Added deployment trigger to deploy to Azure Static Webapps This pull request introduces updates to the deployment workflows, mainly to improve consistency in environment naming and to automate deployments upon pull request merges. The most important changes are grouped below: **Workflow Automation:** * Added a new workflow `.github/workflows/trigger-deploy-on-merge.yml` that triggers the deployment process automatically when a pull request is merged into one of the main branches (`develop`, `staging`, `production`, or `testing`). **Environment Naming Consistency:** * Changed the default environment input in `.github/workflows/deploy-to-azure.yml` from `development` to `develop` to match branch naming conventions. * Updated the environment mapping in the deployment workflow to use `develop` instead of `development`. **Deployment Parameter Improvements:** * Added a new parameter `production_branch` to the deploy-to-azure workflow, set to the selected environment. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary - Added an automated Azure Static Web Apps deployment trigger for merged pull requests targeting `develop`, `staging`, `production`, or `testing`. - Renamed the default deployment environment from `development` to `develop` and updated its mapping. - Added `production_branch` configuration using the selected deployment environment. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 0184cb1 + e71b513 commit eefd61d

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/deploy-to-azure.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
environment:
66
description: 'Environment to deploy to'
77
required: true
8-
default: 'development'
8+
default: 'develop'
99
type: choice
1010
options:
1111
- production
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
case "${{ inputs.environment }}" in
2626
testing) echo "target_env=Testing" >> $GITHUB_OUTPUT ;;
27-
development) echo "target_env=dev" >> $GITHUB_OUTPUT ;;
27+
develop) echo "target_env=dev" >> $GITHUB_OUTPUT ;;
2828
staging) echo "target_env=stage" >> $GITHUB_OUTPUT ;;
2929
production) echo "target_env=prod" >> $GITHUB_OUTPUT ;;
3030
esac
@@ -63,4 +63,5 @@ jobs:
6363
app_location: ".output/public" # App source code path
6464
api_location: "" # Api source code path - optional
6565
output_location: "" # Built app content directory - optional
66-
skip_app_build: true
66+
skip_app_build: true
67+
production_branch: ${{ inputs.environment }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Trigger Deployment on Pull Request Merge
2+
on:
3+
pull_request:
4+
types: [closed]
5+
branches: [develop, staging, production, testing]
6+
permissions:
7+
contents: read
8+
actions: write
9+
10+
jobs:
11+
deploy-frontend:
12+
runs-on: ubuntu-latest
13+
env:
14+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
steps:
16+
- name: Trigger Frontend Deployment Workflow
17+
run: |
18+
gh workflow run deploy-to-azure.yml \
19+
--repo ${{ github.repository }} \
20+
--ref ${{ github.base_ref }} \
21+
--field environment=${{ github.event.pull_request.base.ref }}

0 commit comments

Comments
 (0)