Skip to content

Commit

Permalink
Use action for triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Jan 23, 2025
1 parent 97e9910 commit cad05f9
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ inputs:
outputs:
triggered:
description: Did a deployment trigger? [true|false]
value: ${{ steps.diff.outputs.triggered }}
value: ${{ steps.triggers.outputs.triggered }}

runs:
using: composite
Expand Down Expand Up @@ -97,12 +97,9 @@ runs:
exit 1
fi
# Send triggers to diff action
- id: diff
uses: bcgov/[email protected]
- uses: actions/checkout@v4
with:
triggers: ${{ inputs.triggers }}
diff_branch: ${{ inputs.diff_branch }}
repository: ${{ inputs.repository }}

# Setup OpenShift CLI (oc) and login
- uses: bcgov/[email protected]
Expand All @@ -113,11 +110,6 @@ runs:
oc_server: ${{ inputs.oc_server }}
triggers: ${{ inputs.triggers }}

# Remote/override repo is required if one has been specified (input)
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}

# Process variables and inputs
- id: vars
shell: bash
Expand Down Expand Up @@ -147,7 +139,7 @@ runs:
fi
- name: Deploy
if: steps.diff.outputs.triggered == 'true'
if: steps.triggers.outputs.triggered == 'true'
shell: bash
run: |
# Expand for deployment steps
Expand Down Expand Up @@ -182,7 +174,7 @@ runs:
- name: Route Verification
if: steps.vars.outputs.url &&
( steps.diff.outputs.triggered == 'true' )
( steps.triggers.outputs.triggered == 'true' )
shell: bash
run: |
# Expand for route verification
Expand Down Expand Up @@ -211,13 +203,13 @@ runs:
exit 1
- name: Post-Deployment
if: inputs.post_rollout != '' && steps.diff.outputs.triggered == 'true'
if: inputs.post_rollout != '' && steps.triggers.outputs.triggered == 'true'
shell: bash
run: |
# Run post deployment command (optional)
${{ inputs.post_rollout }}
- if: inputs.delete_completed == 'true' && steps.diff.outputs.triggered == 'true'
- if: inputs.delete_completed == 'true' && steps.triggers.outputs.triggered == 'true'
shell: bash
run: |
# Cleanup completed pods
Expand Down

0 comments on commit cad05f9

Please sign in to comment.