Skip to content

Commit 22bf9b7

Browse files
huydosgtechHuyDo
andauthored
feat: add pipeline GitHub actions (#307)
Co-authored-by: HuyDo <[email protected]>
1 parent 05044b9 commit 22bf9b7

File tree

1 file changed

+143
-0
lines changed

1 file changed

+143
-0
lines changed
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- staging
8+
- production
9+
10+
workflow_dispatch:
11+
inputs:
12+
target:
13+
description: 'Custom trigger for manual runs'
14+
required: true
15+
default: 'buildDev'
16+
type: choice
17+
options:
18+
- buildDev
19+
- codepushDev
20+
- buildStaging
21+
- buildProduction
22+
23+
jobs:
24+
build_develop:
25+
if: github.ref == 'refs/heads/develop'
26+
runs-on: [self-hosted, macos]
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v2
30+
31+
- name: Install dependencies
32+
run: yarn
33+
34+
- name: Build Android
35+
run: fastlane android build type:build buildNumber:${{ github.run_number }} env:development
36+
37+
- name: Build iOS
38+
run: fastlane ios build type:build ci:true buildNumber:${{ github.run_number }} env:development
39+
40+
codepush_develop:
41+
if: github.ref == 'refs/heads/develop'
42+
runs-on: [self-hosted, macos]
43+
needs: build_develop
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v2
47+
48+
- name: Install dependencies
49+
run: yarn
50+
51+
- name: CodePush QA
52+
run: yarn codepush:qa
53+
54+
build_staging:
55+
if: github.ref == 'refs/heads/staging'
56+
runs-on: [self-hosted, macos]
57+
steps:
58+
- name: Checkout code
59+
uses: actions/checkout@v2
60+
61+
- name: Install dependencies
62+
run: yarn
63+
64+
- name: Build Android
65+
run: fastlane android build type:build buildNumber:${{ github.run_number }} env:staging
66+
67+
- name: Build iOS
68+
run: fastlane ios build type:build ci:true buildNumber:${{ github.run_number }} env:staging
69+
70+
build_production:
71+
if: github.ref == 'refs/heads/production'
72+
runs-on: [self-hosted, macos]
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v2
76+
77+
- name: Install dependencies
78+
run: yarn
79+
80+
- name: Build Android
81+
run: fastlane android build type:build buildNumber:${{ github.run_number }} env:production
82+
83+
- name: Build iOS
84+
run: fastlane ios build type:build ci:true buildNumber:${{ github.run_number }} env:production
85+
86+
build_dev_custom:
87+
if: ${{ github.event.inputs.target == 'buildDev' }}
88+
runs-on: [self-hosted, macos]
89+
steps:
90+
- name: Checkout code
91+
uses: actions/checkout@v2
92+
93+
- name: Install dependencies
94+
run: yarn
95+
96+
- name: Build Android
97+
run: fastlane android build type:build buildNumber:${{ github.run_number }} env:development
98+
- name: Build iOS
99+
run: fastlane ios build type:build ci:true buildNumber:${{ github.run_number }} env:development
100+
101+
codepush_dev_custom:
102+
if: ${{ github.event.inputs.target == 'codepushDev' }}
103+
runs-on: [self-hosted, macos]
104+
steps:
105+
- name: Checkout code
106+
uses: actions/checkout@v2
107+
108+
- name: Install dependencies
109+
run: yarn install
110+
111+
- name: CodePush QA
112+
run: yarn codepush:qa
113+
114+
build_staging_custom:
115+
if: ${{ github.event.inputs.target == 'buildStaging' }}
116+
runs-on: [self-hosted, macos]
117+
steps:
118+
- name: Checkout code
119+
uses: actions/checkout@v2
120+
121+
- name: Install dependencies
122+
run: yarn
123+
124+
- name: Build Android
125+
run: fastlane android build type:build buildNumber:${{ github.run_number }} env:staging
126+
- name: Build iOS
127+
run: fastlane ios build type:build ci:true buildNumber:${{ github.run_number }} env:staging
128+
129+
build_production_custom:
130+
if: ${{ github.event.inputs.target == 'buildProduction' }}
131+
runs-on: [self-hosted, macos]
132+
steps:
133+
- name: Checkout code
134+
uses: actions/checkout@v2
135+
136+
- name: Install dependencies
137+
run: yarn
138+
139+
- name: Build Android
140+
run: fastlane android build type:build buildNumber:${{ github.run_number }} env:production
141+
142+
- name: Build iOS
143+
run: fastlane ios build type:build ci:true buildNumber:${{ github.run_number }} env:production

0 commit comments

Comments
 (0)