Broadcast #72
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Broadcast | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
type: choice | |
description: 'choose the environment' | |
required: true | |
default: 'test' | |
options: | |
- 'test' | |
- 'production' | |
jobs: | |
broadcast: | |
runs-on: ubuntu-latest | |
environment: broadcast | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: prepare | |
run: | | |
pip install -r ./tools/requirements.txt | |
if [ "${{ github.event.inputs.environment }}" == "test" ]; then | |
echo "setting up test environment" | |
echo "CHAT_ID=${{ vars.TEST_CHAT_ID }}" >> $GITHUB_ENV | |
echo "TEST=1" >> $GITHUB_ENV | |
else | |
echo "setting up production environment" | |
echo "CHAT_ID=${{ vars.CHAT_ID }}" >> $GITHUB_ENV | |
echo "TEST=0" >> $GITHUB_ENV | |
fi | |
- name: notify | |
run: ./tools/notify.sh | |
env: | |
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
CHAT_ID: ${{ env.CHAT_ID }} | |
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }} | |
MASTODON_URL: ${{ vars.MASTODON_URL }} | |
TEST: ${{ env.TEST }} |