-
Notifications
You must be signed in to change notification settings - Fork 141
49 lines (41 loc) · 1.69 KB
/
seo-image-creator.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |-
python -m pip install --upgrade pip
pip install Pillow==9.3.0
- name: Free space
run: df -h && rm -rf /opt/hostedtoolcache* && df -h
- name: Create Images
run: python code-generators/seo-image-creator.py
- name: Push to Branch
run: |-
if [[ $(git diff | wc -m) == 0 ]]; then
exit 0
fi
BRANCH=github-action-seo-image-creator
git config user.name GitHub Actions
git config user.email [email protected]
git checkout -b $BRANCH
git add .
git commit -m "Code generated by seo-image-creator.py"
git push --set-upstream origin $BRANCH -f
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
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"