-
Notifications
You must be signed in to change notification settings - Fork 16
60 lines (52 loc) · 1.66 KB
/
getbadge.yml
File metadata and controls
60 lines (52 loc) · 1.66 KB
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
60
name: getbadge
on:
push:
branches:
- '*'
workflow_dispatch:
schedule:
# run CI once a week https://jasonet.co/posts/scheduled-actions/
- cron: '0 0 * * 0'
# trigger workflow every minute
# - cron: '*/5 * * * *'
jobs:
update-downloads:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install deps
run: |
pip install numpy pandas imgkit
sudo apt-get install wkhtmltopdf
- name: Get info
run: |
cd assets/
wget "https://dataverse.no/api/info/metrics/filedownloads?parentAlias=ntnu"
python generate_badge.py
- name: Update badge in release
uses: svenstaro/upload-release-action@v2
with:
repo_name: andreped/NoCodeSeg
repo_token: ${{ secrets.CI }}
file: ${{github.workspace}}/assets/badge.png
asset_name: badge.png
file_glob: true
tag: download-badge
overwrite: true
- name: Update SVG in release
uses: svenstaro/upload-release-action@v2
with:
repo_name: andreped/NoCodeSeg
repo_token: ${{ secrets.CI }}
file: ${{github.workspace}}/assets/badge.svg
asset_name: badge.svg
file_glob: true
tag: download-badge
overwrite: true