-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev 336/amplify webhook builds #2906
Open
codechirag123
wants to merge
7
commits into
dev
Choose a base branch
from
dev-336/amplify-webhook-builds
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
60d2292
feat: added new actions to build front-end apps manually
codechirag123 0fabe3f
fix: fixed a typo
codechirag123 c51f5bc
fix: changed the action names for the new front-end build actions
codechirag123 2820d9d
feat: added on-failuew job to notify when the job fails
codechirag123 019ce38
fix: added changes code rabbit
codechirag123 fcc8821
fix: removed redundant step for build action
codechirag123 0010c56
chore: removing on push trigger on the actions
codechirag123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,82 @@ | ||
name: Under Testing - Build and Deploy Backoffice Application | ||
|
||
on: | ||
# push: | ||
# paths: | ||
# # Run this pipeline only if there are changes in specified path | ||
# - 'apps/backoffice-v2/**' | ||
# branches: | ||
# - "dev" | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: choice | ||
description: 'Choose Environment' | ||
required: true | ||
default: 'dev' | ||
options: | ||
- 'dev' | ||
- 'sb' | ||
- 'prod' | ||
workflow_call: | ||
inputs: | ||
environment: | ||
type: string | ||
description: 'Environment' | ||
required: true | ||
default: 'dev' | ||
|
||
jobs: | ||
build: | ||
name: Build Backoffice App | ||
runs-on: ubuntu-latest | ||
environment: ${{ github.event_name == 'push' && github.ref_name || inputs.environment }} | ||
steps: | ||
# Trigger a webhook | ||
- name: Trigger Build webhook | ||
run: | | ||
# curl -X POST -d {} "${{ secrets.BACKOFFICE_WEBHOOK_URL }}" -H "Content-Type:application/json" | ||
response=$(curl -s -w "\n%{http_code}" -X POST -d {} "${{ secrets.BACKOFFICE_WEBHOOK_URL }}" -H "Content-Type:application/json") | ||
status_code=$(echo "$response" | tail -n 1) | ||
if [ "$status_code" -lt 200 ] || [ "$status_code" -ge 300 ]; then | ||
echo "Error: Webhook request failed with status $status_code" | ||
echo "Response: $(echo "$response" | head -n -1)" | ||
exit 1 | ||
fi | ||
|
||
send-to-slack: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: ${{ needs.build.result == 'success' }} | ||
environment: ${{ github.event_name == 'push' && github.ref_name || inputs.environment }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Send alert to Slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}' | ||
slack-message: "Back-office Build initialized in ${{ github.event_name == 'push' && github.ref_name || inputs.environment }}." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }} | ||
|
||
on-failure: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: failure() | ||
environment: ${{ github.event_name == 'push' && github.ref_name || inputs.environment }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Send alert to Slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}' | ||
slack-message: "Backoffice Build job failed in ${{ github.event_name == 'push' && github.ref_name || inputs.environment }}." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }} |
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,82 @@ | ||
name: Under Testing - Build and Deploy Dashboard Application | ||
|
||
on: | ||
# push: | ||
# paths: | ||
# # Run this pipeline only if there are changes in specified path | ||
# - 'apps/workflows-dashboard/**' | ||
# branches: | ||
# - "dev" | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: choice | ||
description: 'Choose Environment' | ||
required: true | ||
default: 'dev' | ||
options: | ||
- 'dev' | ||
- 'sb' | ||
- 'prod' | ||
workflow_call: | ||
inputs: | ||
environment: | ||
type: string | ||
description: 'Environment' | ||
required: true | ||
default: 'dev' | ||
|
||
jobs: | ||
build: | ||
name: Build Dashboard App | ||
runs-on: ubuntu-latest | ||
environment: ${{ github.event_name == 'push' && github.ref_name || inputs.environment }} | ||
steps: | ||
# Trigger a webhook | ||
- name: Trigger Build webhook | ||
run: | | ||
# curl -X POST -d {} "${{ secrets.DASHBOARD_WEBHOOK_URL }}" -H "Content-Type:application/json" | ||
response=$(curl -s -w "\n%{http_code}" -X POST -d {} "${{ secrets.DASHBOARD_WEBHOOK_URL }}" -H "Content-Type:application/json") | ||
status_code=$(echo "$response" | tail -n 1) | ||
if [ "$status_code" -lt 200 ] || [ "$status_code" -ge 300 ]; then | ||
echo "Error: Webhook request failed with status $status_code" | ||
echo "Response: $(echo "$response" | head -n -1)" | ||
exit 1 | ||
fi | ||
|
||
send-to-slack: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: ${{ needs.build.result == 'success' }} | ||
environment: ${{ github.event_name == 'push' && github.ref_name || inputs.environment }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Send alert to Slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}' | ||
slack-message: "Dashboard Build initialized in ${{ github.event_name == 'push' && github.ref_name || inputs.environment }}." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }} | ||
|
||
on-failure: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: failure() | ||
environment: ${{ github.event_name == 'push' && github.ref_name || inputs.environment }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Send alert to Slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}' | ||
slack-message: "Dashboard Build job failed in ${{ github.event_name == 'push' && github.ref_name || inputs.environment }}." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }} |
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,82 @@ | ||
name: Under Testing - Build and Deploy KYB Application | ||
|
||
on: | ||
# push: | ||
# paths: | ||
# # Run this pipeline only if there are changes in specified path | ||
# - 'apps/kyb-app/**' | ||
# branches: | ||
# - "dev" | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: choice | ||
description: 'Choose Environment' | ||
required: true | ||
default: 'dev' | ||
options: | ||
- 'dev' | ||
- 'sb' | ||
- 'prod' | ||
workflow_call: | ||
inputs: | ||
environment: | ||
type: string | ||
description: 'Environment' | ||
required: true | ||
default: 'dev' | ||
codechirag123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
jobs: | ||
build: | ||
name: Build KYB App | ||
runs-on: ubuntu-latest | ||
environment: ${{ github.event_name == 'push' && github.ref_name || inputs.environment }} | ||
steps: | ||
# Trigger a webhook | ||
- name: Trigger Build webhook | ||
run: | | ||
# curl -X POST -d {} "${{ secrets.KYB_WEBHOOK_URL }}" -H "Content-Type:application/json" | ||
response=$(curl -s -w "\n%{http_code}" -X POST -d {} "${{ secrets.KYB_WEBHOOK_URL }}" -H "Content-Type:application/json") | ||
status_code=$(echo "$response" | tail -n 1) | ||
if [ "$status_code" -lt 200 ] || [ "$status_code" -ge 300 ]; then | ||
echo "Error: Webhook request failed with status $status_code" | ||
echo "Response: $(echo "$response" | head -n -1)" | ||
exit 1 | ||
fi | ||
|
||
send-to-slack: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: ${{ needs.build.result == 'success' }} | ||
environment: ${{ github.event_name == 'push' && github.ref_name || inputs.environment }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Send alert to Slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}' | ||
slack-message: "KYB Build initialized in ${{ github.event_name == 'push' && github.ref_name || inputs.environment }}." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }} | ||
|
||
on-failure: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: failure() | ||
environment: ${{ github.event_name == 'push' && github.ref_name || inputs.environment }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Send alert to Slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}' | ||
slack-message: "KYB Build job failed in ${{ github.event_name == 'push' && github.ref_name || inputs.environment }}." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix workflow_call input configuration
The
environment
input in the workflow_call event is marked as both required and has a default value. This is redundant as the default value will never be used when the input is required.Apply this fix:
📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.4)
27-27: input "environment" of workflow_call event has the default value "dev", but it is also required. if an input is marked as required, its default value will never be used
(events)