-
Notifications
You must be signed in to change notification settings - Fork 12
156 lines (140 loc) · 5.59 KB
/
push-trigger.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Build and Push
on:
workflow_dispatch:
inputs:
source_directory:
description: 'Provide mosip plugin utility'
required: true
default: 'sign-in-with-esignet or secure-biometric-interface-integrator or storybook-example'
type: string
destination_branch:
description: 'Provide artifactory branch'
required: true
type: string
push:
branches:
- develop
- master
- 0.*
- 1.*
- MOSIP*
- release*
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build-sign-in-with-esignet:
if: "${{ contains(github.event.inputs.source_directory, 'sign-in-with-esignet') || github.event_name == 'pull_request' || github.event_name == 'push' || false }}"
uses: mosip/kattu/.github/workflows/npm-build.yml@master
with:
SERVICE_LOCATION: ./sign-in-with-esignet
BUILD_ARTIFACT: dist
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
sign-in-with-esignet:
runs-on: ubuntu-latest
needs: build-sign-in-with-esignet
env:
SERVICE_LOCATION: ./sign-in-with-esignet
DIST_BUILD_ARTIFACT: dist
BUILD_ARTIFACT: sign-in-with-esignet
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ env.DIST_BUILD_ARTIFACT }}
path: ${{ env.SERVICE_LOCATION }}
- name: Zip dist directory
run: |
cd ${{ env.SERVICE_LOCATION }}
unzip ${{ env.DIST_BUILD_ARTIFACT }}
mv dist sign-in-with-esignet
zip -r sign-in-with-esignet.zip sign-in-with-esignet/
- name: Upload ZIP artifact
uses: actions/upload-artifact@v3
with:
name: sign-in-with-esignet
path: sign-in-with-esignet/sign-in-with-esignet.zip
- name: Copy ZIP file to mosip-plugins directory
run: |
mkdir -p mosip-plugins
cp ./sign-in-with-esignet/sign-in-with-esignet.zip mosip-plugins/
- name: Pushes mosip-plugin folder
uses: datalbry/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.ACTION_PAT }}
with:
source_folder: mosip-plugins
destination_repo: mosip/artifactory-ref-impl
destination_folder: artifacts/src/mosip-plugins/sign-in-with-esignet/
destination_branch: ${{ github.event.inputs.destination_branch }}
user_name: mosip
if: "${{ github.event_name != 'pull_request' }}"
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,commit,workflow,job # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
if: failure() # Pick up events even if the job fails or is canceled.
build-secure-biometric-interface-integrator:
if: "${{ contains(github.event.inputs.source_directory, 'secure-biometric-interface-integrator') || github.event_name == 'pull_request' || github.event_name == 'push' || false }}"
uses: mosip/kattu/.github/workflows/npm-build.yml@master
with:
SERVICE_LOCATION: ./secure-biometric-interface-integrator
BUILD_ARTIFACT: dist-sbi-integrator
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
secure-biometric-interface-integrator:
if: "${{ github.event_name != 'pull_request' }}"
needs: build-secure-biometric-interface-integrator
uses: mosip/kattu/.github/workflows/npm-publish-to-npm-registry.yml@master
with:
SERVICE_LOCATION: ./secure-biometric-interface-integrator
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
storybook-example:
if: "${{ contains(github.event.inputs.source_directory, 'storybook-example') || github.event_name == 'pull_request' || github.event_name == 'push' || false }}"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: npm Install and Build storybook-example
run: |
cd storybook-example
npm install
npm run build:version:production
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.ACTION_PAT }}
publish_dir: storybook-example/storybook-static
if: "${{ github.event_name != 'pull_request' }}"
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,commit,workflow,job # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
if: failure() # Pick up events even if the job fails or is canceled.
sonarcloud:
if: "${{ github.event_name != 'pull_request' }}"
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,commit,workflow,job # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
if: failure() # Pick up events even if the job fails or is canceled.