Merge pull request #171 from lsst-sqre:tickets/DM-45786 #771
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |