getbadge #228
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |