tldr/.github/workflows/ci.yml

53 lines
1.2 KiB
YAML
Raw Normal View History

2020-06-09 11:10:15 +01:00
name: CI
on: ['push', 'pull_request']
permissions:
contents: read # to fetch code (actions/checkout)
2020-06-09 11:10:15 +01:00
jobs:
ci:
runs-on: ubuntu-latest
name: CI
steps:
- uses: actions/checkout@v4
2022-10-12 11:17:21 +01:00
- uses: actions/setup-python@v4
with:
2022-10-12 11:17:21 +01:00
python-version: '3.10'
cache: 'pip'
2020-06-09 11:10:15 +01:00
2022-10-12 11:17:21 +01:00
- uses: actions/setup-node@v3
with:
2022-10-12 11:17:21 +01:00
node-version: 'lts/*'
cache: 'npm'
2020-06-09 11:10:15 +01:00
2020-06-24 13:11:33 +01:00
- name: Set up PR environment
if: github.event.number != null
run: echo "PULL_REQUEST_ID=${{ github.event.number }}" >> $GITHUB_ENV
2020-06-24 13:11:33 +01:00
2020-06-09 11:10:15 +01:00
- name: Install npm dependencies
run: npm ci
2022-10-12 11:17:21 +01:00
- name: Install pip dependencies
run: pip install -r requirements.txt -r scripts/pdf/requirements.txt
2020-06-09 11:10:15 +01:00
- name: Test
run: npm test
- name: Build
run: bash scripts/build.sh
2020-11-27 09:27:13 +00:00
- name: Build PDF
2021-01-08 09:13:15 +00:00
if: github.repository == 'tldr-pages/tldr' && github.ref == 'refs/heads/main'
2022-10-12 11:17:21 +01:00
working-directory: ./scripts/pdf
scripts: build and deploy PDF pages for translations (#10846) * scrips: build and deploy PDF pages for all languages * cleanup/render.py: reformat code Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * Apply suggestions from code review Co-authored-by: Matthew Peveler <matt.peveler@gmail.com> * scrpts/pdf: update README, refactor code Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * test/ci: building PDF was wildcard Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * test/ci: building translations as wildcard 2 * test/ci: fix flag in PDF building Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * test/ci: update build pdf action Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * test/ci: extend PDF exclusion list Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * cleanup/ci: update PDF translation build Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * scripts/pdf: add website and repo link Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * test/ci: move PDF build to seperate script file Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * test/ci: minor fixes to build pdf script Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * cleanup/ci: update build PDF Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * scripts: update font family, minor fix Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * fix/deploy: sha256sum command Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> --------- Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> Co-authored-by: Matthew Peveler <matt.peveler@gmail.com>
2023-10-13 05:28:02 +01:00
run: bash build-pdf.sh
2020-11-27 09:27:13 +00:00
2020-06-09 11:10:15 +01:00
- name: Deploy
2021-01-08 09:13:15 +00:00
if: github.repository == 'tldr-pages/tldr' && github.ref == 'refs/heads/main'
2020-06-24 13:30:09 +01:00
run: bash scripts/deploy.sh
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}