Skip to content

Commit e13e9bf

Browse files
authored
Update CI workflow to trigger on any branch push or pull request
- Modified deploy-staging.yml to trigger on any push or pull request across all branches. - Added wildcard '**' to ensure the workflow runs on all branches for both push and pull events. - Deployment to staging is limited to direct pushes, while pull requests run the build steps without deploying. This update enables more flexible testing and deployment workflows across different branches, supporting comprehensive CI/CD coverage.
1 parent af4eaa7 commit e13e9bf

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Staging Deployment
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
8+
jobs:
9+
build-and-deploy:
10+
name: Build and Deploy to Staging
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '16' # Specify Node.js version
21+
22+
- name: Install dependencies
23+
run: npm install
24+
25+
- name: Build the application
26+
run: npm run build
27+
28+
- name: Deploy to Staging
29+
if: github.event_name == 'push' # Deploy only on direct pushes, not pull requests
30+
env:
31+
STAGING_API_KEY: ${{ secrets.STAGING_API_KEY }}
32+
STAGING_API_URL: ${{ secrets.STAGING_API_URL }}
33+
run: |
34+
# Replace with your deployment command or script
35+
curl -X POST -H "Authorization: Bearer $STAGING_API_KEY" -d @dist/index.js $STAGING_API_URL

0 commit comments

Comments
 (0)