Build and deploy #889
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: Build and deploy | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo content | |
uses: actions/checkout@v2 | |
- name: Run python code and generate html file | |
env: | |
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} | |
PAGE_DATA_COUNT: 5 | |
run: | | |
pip3 install PyGithub | |
export USER_LIST=$(python3 github_get_members.py) | |
export DURATION_IN_DAYS=$(date -d "$D" '+%d') | |
docker build --target main -t leaderboard . | |
docker run -e GITHUB_TOKEN -e USER_LIST -e DURATION_IN_DAYS -e PAGE_DATA_COUNT -v $(pwd):/app leaderboard | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: build # The folder the action should deploy. |