File tree Expand file tree Collapse file tree 5 files changed +455
-7
lines changed Expand file tree Collapse file tree 5 files changed +455
-7
lines changed Original file line number Diff line number Diff line change 1+ name : deploy to production
2+ on :
3+ workflow_dispatch :
4+ jobs :
5+ deploy :
6+ runs-on : ubuntu-latest
7+ steps :
8+ - uses : actions/checkout@v2
9+ - uses : amondnet/vercel-action@v25
10+ with :
11+ vercel-token : ${{ secrets.VERCEL_TOKEN }}
12+ github-token : ${{ secrets.GITHUB_TOKEN }}
13+ vercel-args : ' --prod'
14+ vercel-org-id : ${{ secrets.ORG_ID}}
15+ vercel-project-id : ${{ secrets.PROD_PROJECT_ID }}
16+ working-directory : ./
17+ alias-domains : https://blogger-prod.vercel.app/
Original file line number Diff line number Diff line change 1+ name : Continuous Integration Workflow
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+ push :
8+ branches :
9+ - main
10+
11+ defaults :
12+ run :
13+ shell : bash
14+
15+ jobs :
16+ Tests :
17+ name : ' Run Tests'
18+ runs-on : ubuntu-latest
19+
20+ steps :
21+ # Step 1: Checkout the code
22+ - name : Checkout Code
23+ uses : actions/checkout@v2
24+
25+ # Step 2: Set up Node.js environment
26+ - name : Install Node.js
27+ uses : actions/setup-node@v3
28+ with :
29+ node-version : 20.11.1
30+ cache : ' npm'
31+
32+ # Step 3: Install dependencies & tests
33+ - name : Install Dependency & Test
34+ working-directory : ./
35+ run : |
36+ npm install
37+
38+
39+ Lint :
40+ needs : Tests
41+ name : ' Run linter'
42+ runs-on : ubuntu-latest
43+
44+ steps :
45+ # Step 1: Checkout the code
46+ - name : Checkout Code
47+ uses : actions/checkout@v2
48+
49+ # Step 2: Install dependencies
50+ - name : ' Install Dependencies'
51+ run : npm install
52+
53+ # Step 3: Run linting and tests
54+ - name : ' Run linter'
55+ run : npm run lint
56+
57+ # Step 4: Build the application
58+ - name : Build Next.js app
59+ run : npm run build
Original file line number Diff line number Diff line change 1+ name : deploy to staging
2+ on :
3+ workflow_dispatch :
4+ inputs :
5+ PR_number :
6+ description : ' Pull request number'
7+ required : true
8+ jobs :
9+ staging :
10+ runs-on : ubuntu-latest
11+ steps :
12+ # Step 1: Checkout Pull Request Code
13+ - name : Checkout Pull Request Code
14+ uses : actions/checkout@v2
15+ with :
16+ ref : refs/pull/${{ github.event.inputs.PR_number }}/merge
17+
18+ # Step 2: Deploy to Staging
19+ - name : Deploy to Vercel
20+ uses : amondnet/vercel-action@v25
21+ with :
22+ vercel-token : ${{ secrets.VERCEL_TOKEN }}
23+ github-token : ${{ secrets.GITHUB_TOKEN }}
24+ vercel-args : ' --preview'
25+ vercel-org-id : ${{ secrets.ORG_ID}}
26+ vercel-project-id : ${{ secrets.STAGING_PROJECT_ID }}
27+ working-directory : ./
28+ alias-domains : pr-${{ github.event.inputs.PR_number }}.staging.dev
29+
You can’t perform that action at this time.
0 commit comments