mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 06:42:10 +02:00
ci.yml: refactor workflow (#8927)
This commit is contained in:
parent
eb38d1d75c
commit
cf2f75591f
1 changed files with 13 additions and 19 deletions
32
.github/workflows/ci.yml
vendored
32
.github/workflows/ci.yml
vendored
|
@ -12,15 +12,17 @@ jobs:
|
|||
name: CI
|
||||
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
python-version: '3.10'
|
||||
cache: 'pip'
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Set up PR environment
|
||||
if: github.event.number != null
|
||||
|
@ -29,8 +31,8 @@ jobs:
|
|||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Install python dependencies
|
||||
run: python3 -m pip install -r requirements.txt
|
||||
- name: Install pip dependencies
|
||||
run: pip install -r requirements.txt -r scripts/pdf/requirements.txt
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
@ -38,18 +40,10 @@ jobs:
|
|||
- name: Build
|
||||
run: bash scripts/build.sh
|
||||
|
||||
- name: Setup Python for PDF generation
|
||||
if: github.repository == 'tldr-pages/tldr' && github.ref == 'refs/heads/main'
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Build PDF
|
||||
if: github.repository == 'tldr-pages/tldr' && github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
cd scripts/pdf/
|
||||
pip3 install -r requirements.txt
|
||||
python3 render.py ../../pages -c solarized-light
|
||||
working-directory: ./scripts/pdf
|
||||
run: python render.py ../../pages -c solarized-light
|
||||
|
||||
- name: Deploy
|
||||
if: github.repository == 'tldr-pages/tldr' && github.ref == 'refs/heads/main'
|
||||
|
|
Loading…
Add table
Reference in a new issue