Skip to content

Commit

Permalink
Merge pull request #8 from TanmoySG/update-workflow
Browse files Browse the repository at this point in the history
Update Workflow to add Manual Trigger
  • Loading branch information
TanmoySG authored Sep 14, 2024
2 parents 9d08190 + fe41384 commit 954be12
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/data-sync.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Sync Data

on:
workflow_dispatch:
inputs:
confirm:
type: boolean
description: 'Confirm Manual Trigger for Sync Job'
required: true
push:
branches: ['main']
paths: ['data/*/records.json']
Expand All @@ -22,9 +28,15 @@ jobs:
WDB_PASSWORD: ${{ secrets.WDB_PASSWORD }}
run: |
echo '### Sync Summary 📋' >> $GITHUB_STEP_SUMMARY
trigger=$(echo ${{ github.event_name }})
if [ $trigger == "workflow_dispatch" ]; then
echo "💡 Trigger: Manual" >> $GITHUB_STEP_SUMMARY
else if [ $trigger == "push" ]; then
echo "💡 Trigger: Record Updated" >> $GITHUB_STEP_SUMMARY
fi
cd ${GITHUB_WORKSPACE}/push
pip install -r requirements.txt
echo "Sync Run Logs" >> $GITHUB_STEP_SUMMARY
echo "🪵 Sync Run Logs" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
python3 app.py
cat push.log
Expand Down

0 comments on commit 954be12

Please sign in to comment.