Skip to content

Notify to Twitter (Daily) #1058

Notify to Twitter (Daily)

Notify to Twitter (Daily) #1058

Workflow file for this run

name: Notify to Twitter (Daily)
on:
schedule:
- cron: '0 23 * * *' # At 8:00 am everyday (JST)
jobs:
notify:
runs-on: ubuntu-latest
name: Notify to Twitter (Daily)
steps:
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: registry.camph.net
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Pull and run image from Registry
run: |
docker pull registry.camph.net/schedule-notifier
docker run --rm \
-e CSN_API_KEY=$TWITTER_API_KEY \
-e CSN_API_SECRET=$TWITTER_API_SECRET \
-e CSN_ACCESS_TOKEN=$TWITTER_ACCESS_TOKEN \
-e CSN_ACCESS_TOKEN_SECRET=$TWITTER_ACCESS_TOKEN_SECRET \
registry.camph.net/schedule-notifier \
schedule-notifier
env:
TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
TWITTER_API_SECRET: ${{ secrets.TWITTER_API_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Notify to Slack
uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()