Skip to content

Commit

Permalink
updating code
Browse files Browse the repository at this point in the history
  • Loading branch information
tosin2013 committed Nov 28, 2023
1 parent 9b2fb85 commit b71e275
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/configure-rhel8-equinix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Set Environment Variables
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "TARGET_SERVER=${{ github.event.inputs.target_server }}" >> $GITHUB_ENV
echo "DOMAIN=${{ github.event.inputs.domain }}" >> $GITHUB_ENV
echo "FORWARDER=${{ github.event.inputs.forwarder }}" >> $GITHUB_ENV
echo "HOSTNAME=${{ github.event.inputs.hostname }}" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "repository_dispatch" ]; then
echo "TARGET_SERVER=${{ github.event.client_payload.data_key.target_server }}" >> $GITHUB_ENV
echo "DOMAIN=${{ github.event.client_payload.data_key.domain }}" >> $GITHUB_ENV
echo "FORWARDER=${{ github.event.client_payload.data_key.forwarder }}" >> $GITHUB_ENV
echo "HOSTNAME=${{ github.event.client_payload.data_key.hostname }}" >> $GITHUB_ENV
fi
- name: Configure RHEL 8 Equinix Server
uses: appleboy/[email protected]
with:
Expand Down Expand Up @@ -79,9 +92,9 @@ jobs:
event_type: "custom_restart",
client_payload: {
data_key: {
hostname: 'testing', // Replace with actual dynamic value if needed
hostname: '${{ env.HOSTNAME }}',
target_server: '${{ env.TARGET_SERVER }}',
forwarder: '${{ env.DOMAIN }}',
forwarder: '${{ env.FORWARDER }}',
domain: '${{ env.DOMAIN }}'
}
}
Expand All @@ -91,6 +104,6 @@ jobs:
core.setFailed(`Dispatch failed: ${error.message}`);
}
}
run();

0 comments on commit b71e275

Please sign in to comment.