-
Notifications
You must be signed in to change notification settings - Fork 12
59 lines (48 loc) · 1.48 KB
/
sync_github.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
56
57
58
59
name: Sync GitHub Repo Data
on:
schedule:
- cron: '0 */3 * * *'
workflow_dispatch:
jobs:
run_script:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install dependencies
run: |
bundle install
- name: Migration
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
REPO_FULL_NAME: ${{ secrets.REPO_FULL_NAME }}
PYPI_PACKAGE: ${{ secrets.PYPI_PACKAGE }}
run: |
bundle exec rails runner "RetryableRake.db_create"
bundle exec rails runner "RetryableRake.db_migrate"
- name: Sync GitHub Repo Data
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN}}
REPO_FULL_NAME: ${{ secrets.REPO_FULL_NAME }}
PYPI_PACKAGE: ${{ secrets.PYPI_PACKAGE }}
run: |
bundle exec rails runner "SyncGithub.run!"
- name: Rebuild Evidence
run: |
if [ -n "${{ secrets.BUILD_HOOK }}" ]; then
curl -X POST -d {} ${{ secrets.BUILD_HOOK }}
fi