-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (31 loc) · 1.06 KB
/
deploy-staging.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Staging Deployment
on:
push:
pull_request:
jobs:
build-and-deploy:
name: Build and Deploy to Staging
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: List root directory contents for debugging
run: ls -R
- name: List client/public directory contents for debugging
run: ls client/public
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16' # Specify Node.js version
- name: Install dependencies
run: npm install
- name: Build the application
run: npm run build
- name: Deploy to Staging
if: github.event_name == 'push' # Deploy only on direct pushes, not pull requests
env:
STAGING_API_KEY: ${{ secrets.STAGING_API_KEY }}
STAGING_API_URL: ${{ secrets.STAGING_API_URL }}
run: |
# Replace with your deployment command or script
curl -X POST -H "Authorization: Bearer $STAGING_API_KEY" -d "@/dist/index.js" "$STAGING_API_URL"