Social Post #320
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: Social Post | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Runs every day at midnight UTC | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
post: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21.5 | |
- name: go build | |
working-directory: . | |
run: go build -o bin/ferret ./cmd/ferret | |
- name: run application | |
env: | |
MASTODON_INSTANCE_URL: ${{ vars.MASTODON_INSTANCE_URL }} | |
FACEBOOK_PAGE_ID: ${{ vars.FACEBOOK_PAGE_ID }} | |
THREAD_USER_ID: ${{ vars.THREAD_USER_ID }} | |
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} | |
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} | |
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} | |
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | |
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | |
LINKEDIN_ACCESS_TOKEN: ${{secrets.LINKEDIN_ACCESS_TOKEN}} | |
FACEBOOK_ACCESS_TOKEN: ${{secrets.FACEBOOK_ACCESS_TOKEN}} | |
THREAD_ACCESS_TOKEN: ${{ secrets.THREAD_ACCESS_TOKEN }} | |
run: ./bin/ferret | |
- name: Commit and push changes | |
shell: bash | |
continue-on-error: true | |
run: | | |
git config --local user.email ${{ secrets.USER_EMAIL }} | |
git config --local user.name ${{ secrets.USER_NAME }} | |
git add config.json | |
git commit -m "bot:Update last run time" | |
git push |