SEO Image Update #274
This file contains hidden or 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: SEO Image Update | |
| on: | |
| schedule: | |
| - cron: "0 10 * * 5" # Runs "at 10 UTC every Friday" (see https://crontab.guru) | |
| workflow_dispatch: # Runs on manual trigger | |
| jobs: | |
| generate-seo-images: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Free space | |
| run: df -h && rm -rf /opt/hostedtoolcache* && df -h | |
| - name: Install dependencies | |
| run: |- | |
| python -m pip install --upgrade pip | |
| pip install pillow==11.1.0 matplotlib==3.9.2 | |
| - name: Create Images | |
| run: python code-generators/seo-image-creator.py | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| branch: github-action-seo-image-creator | |
| title: "Update SEO images" | |
| body: "Automated changes from seo-image-creator.py." | |
| committer: "GitHub Actions <github-actions@github.com>" | |
| author: "GitHub Actions <github-actions@github.com>" | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_KEY }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET }} | |
| aws-region: us-west-1 | |
| - name: Copy files to the S3 website content bucket | |
| run: |- | |
| mkdir -p ./Resources/social/writing-algorithms/indicators/supported-indicators | |
| cp ./Resources/indicators/images/* ./Resources/social/writing-algorithms/indicators/supported-indicators | |
| aws s3 cp ./Resources/social s3://${{ secrets.AWS_BUCKET }} --recursive --acl bucket-owner-full-control --exclude "*" --include "*.png" --content-type "image/png" |