Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

weekday-campaign

weekday-campaign #124

name: weekday-campaign
on:
workflow_dispatch:
schedule:
- cron: 0 22 * * 1,3,4,5 # 10pm UTC (6PM EST) on Monday, Wednesday, Thursday, Friday
jobs:
pick-campaign:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install `omega-moderne-client`
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .[cli,github-scripts]
- name: Pick campaign to execute
run: |
export CAMPAIGN_NAME=$(.github/scripts/pick-campaign.py)
if [ $? -ne 0 ] || [ -z "$CAMPAIGN_NAME" ]; then
echo "No campaign to run"
exit 1
fi
echo "CAMPAIGN_NAME=$CAMPAIGN_NAME"
echo "CAMPAIGN_NAME=$CAMPAIGN_NAME" >> $GITHUB_ENV
outputs:
campaign-name: ${{ env.CAMPAIGN_NAME }}
run-campaign-scheduled:
needs: [pick-campaign]
uses: ./.github/workflows/recurring-campaign-base.yml
with:
campaign_identifier: ${{ needs.pick-campaign.outputs.campaign-name }}
secrets: inherit