Notify to Twitter (Weekly) #140
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 (Weekly) | |
on: | |
schedule: | |
- cron: '0 23 * * 1' # At 8:00 am every Monday (JST) | |
jobs: | |
notify: | |
runs-on: ubuntu-latest | |
name: Notify to Twitter (Weekly) | |
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 \ | |
-e CSN_WEEK=1 \ | |
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() |