-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (92 loc) · 3.74 KB
/
genparker-build-and-deploy.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: genparker-pipeline
on:
push:
branches:
- 'main'
env:
BEFORE_SHA: ${{ github.event.before }}
DOCKER_ENVIRONMENT: 'latest'
ORG_GRADLE_PROJECT_RELEAF_UPLOAD_STORE_PASSWORD: ${{ secrets.RELEAF_UPLOAD_STORE_PASSWORD }}
ORG_GRADLE_PROJECT_RELEAF_UPLOAD_KEY_PASSWORD: ${{ secrets.RELEAF_UPLOAD_KEY_PASSWORD }}
RELEAF_GENPARKER_KEYS: ${{ secrets.RELEAF_GENPARKER_KEYS }}
jobs:
init:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.setvars.outputs.environment }}
branch: ${{ steps.setvars.outputs.branch }}
steps:
- name: Set variables
id: setvars
run: |
echo "::set-output name=environment::production"
echo "::set-output name=branch::main"
prepare-fe:
runs-on: ubuntu-latest
needs: init
steps:
- uses: BesLogic/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: publish affected
run: npx nx affected --target=publish-fe --head=${{needs.init.outputs.branch}} --base=$BEFORE_SHA --configuration=${{needs.init.outputs.environment }} --parallel=5
prepare-be:
runs-on: ubuntu-latest
needs: init
steps:
- uses: BesLogic/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: publish affected
run: npx nx affected --target=publish --head=${{needs.init.outputs.branch}} --base=$BEFORE_SHA --configuration=${{needs.init.outputs.environment }} --parallel=5
- name: 'cp for kustomize'
run: |
cp -r configs/genparker/base configs/genparker/overlay/philantropy/base & \
cp configs/genparker/overlay/kustomization.yml configs/genparker/overlay/philantropy
- name: 'Kustomize Build'
uses: int128/kustomize-action@v1
id: kustomize
with:
kustomization: 'overlay/*/kustomization.yml'
base-directory: 'configs/genparker'
- run: cp -r ${{ steps.kustomize.outputs.directory }} deployment_configs
- name: Update with kustomize
run: |
git add -A
git config --global user.name 'GenParker'
git config --global user.email '[email protected]'
git commit -am "Updating the project's structure"
git push -f origin main:deployment/philantropy
prepare-mobile:
runs-on: ubuntu-latest
needs: init
steps:
- uses: BesLogic/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies Mobile
run: cd apps/releaf/mobile && npm i --ignore-scripts
- uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '17'
- name: Set up Android SDK
uses: android-actions/setup-android@v2
with:
api-level: 34
target: default
channel: stable
- name: get file
run: |
curl -o ./apps/releaf/mobile/android/app/releaf.keystore -H "Authorization: token ${RELEAF_GENPARKER_KEYS}" https://raw.githubusercontent.com/andy2great/releaf-genparker-keys/main/releaf.keystore
- name: publish affected
run: npx nx affected --target=build-mobile --head=${{needs.init.outputs.branch}} --base=$BEFORE_SHA --configuration=${{needs.init.outputs.environment}} --parallel=5
- uses: r0adkll/upload-google-play@v1
if: ${{ hashFiles('apps/releaf/mobile/android/app/build/outputs/bundle/release/app-release.aab') != '' }}
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.release
releaseFiles: apps/releaf/mobile/android/app/build/outputs/bundle/release/app-release.aab
track: alpha
status: completed
inAppUpdatePriority: 2