mirror of
https://github.com/baz-scm/awesome-reviewers.git
synced 2025-08-20 18:58:52 +03:00
* chore: merge build and deploy jobs * Use latest upload-pages-artifact * Use upload-artifact v4
68 lines
1.8 KiB
YAML
68 lines
1.8 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:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
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
|
|
- name: Remove symlinks in _site
|
|
run: |
|
|
find ./_site -type l -exec rm -v {} +
|
|
- name: Check for symlinks and hardlinks in _site
|
|
run: |
|
|
echo "\U1F50D Searching for symlinks:"
|
|
find ./_site -type l || true
|
|
|
|
echo "\U1F50D Searching for hardlinks:"
|
|
find ./_site -type f -links +1 || true
|
|
- name: Add .nojekyll file
|
|
run: touch _site/.nojekyll
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: github-pages
|
|
path: ./_site
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|