Skip to content

Commit

Permalink
disable deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dv-hossam-radwan committed May 2, 2024
1 parent 77f57c2 commit c593069
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions .github/workflows/build-product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,42 +131,42 @@ jobs:
ecr_repositories: ${{ needs.prepare-build.outputs.ecr_repos }}
current_image_tag: ${{ needs.prepare-build.outputs.image_tag1 }}
additional_image_tag: ${{ needs.prepare-build.outputs.image_tag2 }}
deploy:
needs: [prepare-build, post-build]
# Add always() as otherwise the job is being skipped: https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
if: ${{ always() && needs.post-build.result == 'success' && fromJSON(needs.prepare-build.outputs.trigger_automatic_deployment) }}
runs-on: ubuntu-22.04
strategy:
matrix:
customer: ${{ fromJSON(needs.prepare-build.outputs.customers) }}
steps:
- name: determine stage to be deployed to
id: get-parameters
run: |
# Try to split the customer from the format customer:stage
customer="$(echo "$CUSTOMER_FULL" | cut -d ":" -s -f 1)"
stage="$(echo "$CUSTOMER_FULL" | cut -d ":" -s -f 2)"
# If nothing is found, we assume we just got the customer
if [ -z "$customer" ]; then
customer="$CUSTOMER_FULL"
fi
# And will deploy to develop if no stage is defined
if [ -z "$stage" ]; then
echo "customer $CUSTOMER_FULL does not include stage, using develop instead"
stage="develop"
fi
echo "customer=$customer" >> "$GITHUB_OUTPUT"
echo "stage=$stage" >> "$GITHUB_OUTPUT"
env:
CUSTOMER_FULL: ${{ matrix.customer }}
shell: bash
- name: trigger deployment
uses: datavisyn/github-action-trigger-workflow@v1
with:
owner: "datavisyn"
repo: "infrastructure-k8s"
github_token: ${{ secrets.DATAVISYN_BOT_REPO_TOKEN }}
workflow_file_name: "deploy-app.yml"
ref: ${{ env.WORKFLOW_BRANCH }}
github_user: ${{ secrets.DV_BOT_USER }}
client_payload: '{ "app": "${{ needs.prepare-build.outputs.app }}", "customer": "${{ steps.get-parameters.outputs.customer }}", "stage": "${{ steps.get-parameters.outputs.stage }}", "sub_app": "${{ needs.prepare-build.outputs.sub_app }}", "branch": "${{ needs.prepare-build.outputs.image_tag2 }}" }'
# deploy:
# needs: [prepare-build, post-build]
# # Add always() as otherwise the job is being skipped: https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
# if: ${{ always() && needs.post-build.result == 'success' && fromJSON(needs.prepare-build.outputs.trigger_automatic_deployment) }}
# runs-on: ubuntu-22.04
# strategy:
# matrix:
# customer: ${{ fromJSON(needs.prepare-build.outputs.customers) }}
# steps:
# - name: determine stage to be deployed to
# id: get-parameters
# run: |
# # Try to split the customer from the format customer:stage
# customer="$(echo "$CUSTOMER_FULL" | cut -d ":" -s -f 1)"
# stage="$(echo "$CUSTOMER_FULL" | cut -d ":" -s -f 2)"
# # If nothing is found, we assume we just got the customer
# if [ -z "$customer" ]; then
# customer="$CUSTOMER_FULL"
# fi
# # And will deploy to develop if no stage is defined
# if [ -z "$stage" ]; then
# echo "customer $CUSTOMER_FULL does not include stage, using develop instead"
# stage="develop"
# fi
# echo "customer=$customer" >> "$GITHUB_OUTPUT"
# echo "stage=$stage" >> "$GITHUB_OUTPUT"
# env:
# CUSTOMER_FULL: ${{ matrix.customer }}
# shell: bash
# - name: trigger deployment
# uses: datavisyn/github-action-trigger-workflow@v1
# with:
# owner: "datavisyn"
# repo: "infrastructure-k8s"
# github_token: ${{ secrets.DATAVISYN_BOT_REPO_TOKEN }}
# workflow_file_name: "deploy-app.yml"
# ref: ${{ env.WORKFLOW_BRANCH }}
# github_user: ${{ secrets.DV_BOT_USER }}
# client_payload: '{ "app": "${{ needs.prepare-build.outputs.app }}", "customer": "${{ steps.get-parameters.outputs.customer }}", "stage": "${{ steps.get-parameters.outputs.stage }}", "sub_app": "${{ needs.prepare-build.outputs.sub_app }}", "branch": "${{ needs.prepare-build.outputs.image_tag2 }}" }'

0 comments on commit c593069

Please sign in to comment.