-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
52 lines (38 loc) · 1.15 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: CI
on: ['push', 'pull_request']
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
ci:
runs-on: ubuntu-latest
name: CI
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Set up PR environment
if: github.event.number != null
run: echo "PULL_REQUEST_ID=${{ github.event.number }}" >> $GITHUB_ENV
- name: Install npm dependencies
run: npm ci
- name: Install pip dependencies
run: pip install -r requirements.txt -r scripts/pdf/requirements.txt
- name: Test
run: npm test
- name: Build
run: bash scripts/build.sh
- name: Build PDF
if: github.repository == 'tldr-pages/tldr' && github.ref == 'refs/heads/main'
working-directory: ./scripts/pdf
run: bash build-pdf.sh
- name: Deploy
if: github.repository == 'tldr-pages/tldr' && github.ref == 'refs/heads/main'
run: bash scripts/deploy.sh
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}