mirror of
https://github.com/baz-scm/awesome-reviewers.git
synced 2025-08-20 18:58:52 +03:00
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.x'
|
|
- name: Install Python dependencies
|
|
run: pip install pyyaml
|
|
- name: Generate leaderboard
|
|
run: python generate_leaderboard.py
|
|
- name: Commit leaderboard data
|
|
run: |
|
|
if [[ `git status --porcelain` ]]; then
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git add _data/leaderboard.json assets/data/contributors.json
|
|
git commit -m "Update leaderboard [skip ci]"
|
|
git push
|
|
fi
|
|
- uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: '3.2'
|
|
bundler-cache: true
|
|
- name: Build site
|
|
run: bundle exec jekyll build
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
path: ./_site
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v2
|