File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ name : Release Dev
2+
3+ on :
4+ push :
5+ branches :
6+ - release-*
7+ tags :
8+ - v*.*.*
9+
10+ jobs :
11+ call-function :
12+ name : Call function
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+
17+ - name : Setup Dagger
18+ uses : dagger/dagger-for-github@v5
19+
20+ - name : Setup Node.js
21+ uses : actions/setup-node@v4
22+ with :
23+ node-version : 20
24+
25+ - name : Install dependencies
26+ run : yarn install
27+
28+ - name : Call script
29+ working-directory : ./scripts/pipelines
30+ run : ./release.ts
31+ env :
32+ MODE : " prod"
33+ GH_TOKEN : ${{ secrets.GH_TOKEN_PROD }}
Original file line number Diff line number Diff line change 1- name : Init
1+ name : Release Dev
22
33on :
4- workflow_call :
4+ push :
5+ branches :
6+ - release-*
57
68jobs :
7- init :
8- name : Init
9+ call-function :
10+ name : Call function
911 runs-on : ubuntu-latest
1012 steps :
1113 - uses : actions/checkout@v4
2022
2123 - name : Install dependencies
2224 run : yarn install
25+
26+ - name : Call script
27+ working-directory : ./scripts/pipelines
28+ run : ./release.ts
29+ env :
30+ MODE : " stg"
31+ GH_TOKEN : ${{ secrets.GH_TOKEN_STG }}
File renamed without changes.
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const Constants = {
66 token : $ . env . GH_TOKEN ,
77 // Owner/repo
88 devRepo : "dev-n8v/dev-n8v.github.io" ,
9+ stg : "stg-n8v/stg-n8v.github.io" ,
910 prodRepo : "ndthanhdev/ndthanhdev.github.io" ,
1011} ;
1112
@@ -18,8 +19,15 @@ export const getPublishRemote = () => {
1819 throw new Error ( "GH_TOKEN is required" ) ;
1920 }
2021
22+ const repo =
23+ Constants . mode === "prod"
24+ ? Constants . prodRepo
25+ : Constants . mode === "stg"
26+ ? Constants . stg
27+ : Constants . devRepo ;
28+
2129 // https://git:${GITHUB_TOKEN}@github .com/ndthanhdev/ndthanhdev.github.io.git
22- const remote = `https://oauth2:${ Constants . token } @github.com/${ Constants . mode === "prod" ? Constants . prodRepo : Constants . devRepo } .git` ;
30+ const remote = `https://oauth2:${ Constants . token } @github.com/${ repo } .git` ;
2331
2432 return remote ;
2533} ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ declare module "process" {
22 global {
33 namespace NodeJS {
44 interface ProcessEnv {
5- MODE ?: "dev" | "prod" ;
5+ MODE ?: "dev" | "stg" | " prod";
66 GH_TOKEN ?: string ;
77 GATSBY_BUILD_NUMBER ?: string ;
88 GATSBY_REV ?: string ;
You can’t perform that action at this time.
0 commit comments