-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MOSIP-29251] Updated workflows as per reusable workflow format (#77)
* [MOSIP-29251] Updated workflows as per reusable workflow format [MOSIP-25631] Signed-off-by: syed salman <[email protected]> * [MOSIP-29251] updated push-trigger.yml [MOSIP-25631] Signed-off-by: syed salman <[email protected]> --------- Signed-off-by: syed salman <[email protected]>
- Loading branch information
1 parent
46c97f5
commit d1002c2
Showing
6 changed files
with
194 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Tagging of repos | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
TAG: | ||
description: 'Tag to be published' | ||
required: true | ||
type: string | ||
BODY: | ||
description: 'Release body message' | ||
required: true | ||
default: 'Changes in this Release' | ||
type: string | ||
PRE_RELEASE: | ||
description: 'Pre-release? True/False' | ||
required: true | ||
default: False | ||
type: string | ||
DRAFT: | ||
description: 'Draft? True/False' | ||
required: false | ||
default: False | ||
type: string | ||
|
||
jobs: | ||
tag-branch: | ||
uses: mosip/kattu/.github/workflows/tag.yml@master | ||
with: | ||
TAG: ${{ inputs.TAG }} | ||
BODY: ${{ inputs.BODY }} | ||
PRE_RELEASE: ${{ inputs.PRE_RELEASE }} | ||
DRAFT: ${{ inputs.DRAFT }} | ||
secrets: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters