ci.yml: refactor workflow (#8927)

pull/1/head
Anton Yakutovich 2022-10-12 14:17:21 +04:00 committed by GitHub
parent eb38d1d75c
commit cf2f75591f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 19 deletions

View File

@ -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'