From c54dbf79d45827ee1400df09c449d513eefaff0d Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Thu, 5 Oct 2023 20:31:11 -0400 Subject: [PATCH] Add CI config, fixup docs build --- .github/workflows/ci.yml | 34 +++++++++++++++ .github/workflows/deploy-gh-pages.yml | 61 -------------------------- .github/workflows/pages.yml | 63 +++++++++++++++++++++++++++ docs/mkdocs.yml | 6 --- 4 files changed, 97 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/deploy-gh-pages.yml create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8162dbf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: Build, lintm & test + +on: + push: + branches: main + pull_request: + branches: main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20.x + cache: "npm" + cache-dependency-path: "package-lock.json" + - run: npm ci + - run: npm run lint:eslint + - run: npm run lint:prettier + - run: npm run lint:types + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20.x + cache: "npm" + cache-dependency-path: "package-lock.json" + - run: npm ci + - run: npm run build + - run: npm run test diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml deleted file mode 100644 index 9542464..0000000 --- a/.github/workflows/deploy-gh-pages.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Deploy to GitHub Pages - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-22.04 - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 19.x - - - name: Set up Python 3.10 - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install Node dependencies - run: | - npm ci - - - name: Install Python dependencies - run: | - python -m pip install -r docs/requirements.txt - - - name: Build KiCanvas - run: | - npm run build-no-check - - - name: Build docs - run: mkdocs build - working-directory: docs - - - name: Upload pages as an artifact - uses: actions/upload-pages-artifact@v1 - with: - path: docs/site - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..a7d8959 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,63 @@ +name: Deploy to GitHub Pages + +on: + workflow_dispatch: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-22.04 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + cache: "npm" + cache-dependency-path: "package-lock.json" + + - name: Set up Python 3.10 + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install Node dependencies + run: | + npm ci + + - name: Install Python dependencies + run: | + python -m pip install -r docs/requirements.txt + + - name: Build KiCanvas + run: | + npm run build-no-check + + - name: Build docs + run: mkdocs build + working-directory: docs + + - name: Upload pages as an artifact + uses: actions/upload-pages-artifact@v1 + with: + path: docs/site + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index bb0b8b5..461a298 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -24,12 +24,6 @@ markdown_extensions: - pymdownx.superfences - pymdownx.magiclink - md_in_html - - toc: - toc_depth: 2-3 - - markdown_link_attr_modifier: - new_tab: "external_only" - custom_attrs: - referrerpolicy: "origin" nav: - "Home": home.md - "Standalone App": index.md