Skip to content

DM-40262: Convert Squareone into a front-end monorepo #580

DM-40262: Convert Squareone into a front-end monorepo

DM-40262: Convert Squareone into a front-end monorepo #580

Workflow file for this run

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/**'
tags:
- '*'
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@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
docs:
- 'docs/**'
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
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@v3
- 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@v3
- 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 setuptools
pip install -r docs/requirements.txt
- name: Build documentation
working-directory: docs
run: make html
- name: Upload documentation
uses: lsst-sqre/ltd-upload@v1
with:
project: 'squareone'
dir: 'docs/_build/html'
username: ${{ secrets.LTD_USERNAME }}
password: ${{ secrets.LTD_PASSWORD }}