-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (87 loc) · 2.47 KB
/
ci.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
'on':
push:
branches-ignore:
# These should always correspond to pull requests, so ignore them for
# the push trigger and let them be triggered by the pull_request
# trigger, avoiding running the workflow twice. This is a minor
# optimization so there's no need to ensure this is comprehensive.
- 'dependabot/**'
- 'renovate/**'
- 'tickets/**'
- 'u/**'
- 'changeset-release/**'
pull_request: {}
jobs:
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
docs:
- 'docs/**'
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # partial depth for Turbo Repo
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Set up node
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version-file: '.nvmrc'
- name: Install npm packages
run: pnpm install
- name: Check formatting
run: pnpm run format:check
- name: Lint
run: pnpm run lint
- name: Build
run: pnpm run build
build-squareone:
needs:
- test
timeout-minutes: 15
if: >
startsWith(github.ref, 'refs/tags/') || startsWith(github.head_ref, 'tickets/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lsst-sqre/build-and-push-to-ghcr@v1
id: build
with:
image: lsst-sqre/squareone
github_token: ${{ secrets.GITHUB_TOKEN }}
dockerfile: apps/squareone/Dockerfile
docs:
needs: [changes]
if: ${{ needs.changes.outputs.docs == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip nox
- name: Build documentation
run: nox -s docs
- name: Upload documentation
uses: lsst-sqre/ltd-upload@v1
with:
project: 'squareone'
dir: 'docs/_build/html'
username: ${{ secrets.LTD_USERNAME }}
password: ${{ secrets.LTD_PASSWORD }}