forked from galaxyproject/training-material
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (41 loc) · 1.36 KB
/
matrix.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
name: "[Cron] Send news to Matrix"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# We'll run this daily at noon.
- cron: '0 12 * * *'
workflow_dispatch:
jobs:
runner-job:
if: github.repository_owner == 'galaxyproject'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 200
# BEGIN Dependencies
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
- uses: actions/cache@v2
with:
path: |
vendor/bundle
~/.npm
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}-node-
${{ runner.os }}-gems-
- name: Install dependencies
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle pristine ffi
# END Dependencies
- name: Send announcements to matrix
run: |
commit=$(git log --since "24 hours ago" --format=%H --first-parent main| tail -n 1)
bundle exec ruby bin/news.rb -p "${commit}~1" --matrix-post
env:
MATRIX_ACCESS_TOKEN: ${{ secrets.matrix_access_token }}