-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (43 loc) · 1.54 KB
/
cron:rotate_branding.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
50
51
52
53
54
55
name: Rotate branding
on:
schedule:
- cron: 00 04 * * *
env:
GRAVATAR_EMAIL: ${{ secrets.GRAVATAR_EMAIL }}
GRAVATAR_PASSWORD: ${{ secrets.GRAVATAR_PASSWORD }}
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 }}
jobs:
rotate_branding:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
- name: Install dependencies
run: |
sudo apt-get install libmagickwand-dev
bundle install --frozen --jobs 4 --retry 3 --without development test
- name: Rotate Gravatar branding
id: gravatar
run: rake brand_rotator:gravatar
continue-on-error: true
- name: Rotate Twitter branding
id: twitter
run: rake brand_rotator:twitter
continue-on-error: true
- name: Report failures
run: |
[[ "${{ steps.gravatar.outcome }}" == "success" ]]
GRAVATAR_SUCCESS=$?
[[ "${{ steps.twitter.outcome }}" == "success" ]]
TWITTER_SUCCESS=$?
[[ "$GRAVATAR_SUCCESS" == "0" ]] ||
echo "::error::Gravatar rotation did not succeed"
[[ "$TWITTER_SUCCESS" == "0" ]] ||
echo "::error::Twitter rotation did not succeed"
(
[[ "$GRAVATAR_SUCCESS" == "0" ]] &&
[[ "$TWITTER_SUCCESS" == "0" ]]
) || exit 1