Notify to Twitter (Daily) #833
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: 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@v1 | |
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() |