quartz-research-note/.github/workflows/ci.yaml

89 lines
2.0 KiB
YAML
Raw Normal View History

2023-07-23 00:27:41 +00:00
name: Build and Test
2021-07-18 15:54:00 +00:00
on:
push:
branches:
2023-08-20 21:34:00 +00:00
- v4
2023-08-21 11:10:52 +00:00
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
2021-07-18 15:54:00 +00:00
jobs:
2023-07-20 05:00:44 +00:00
build-and-test:
2023-08-07 02:52:30 +00:00
if: ${{ github.repository == 'jackyzha0/quartz' }}
2023-08-03 03:56:31 +00:00
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
2023-05-29 00:44:08 +00:00
permissions:
contents: write
2021-07-18 15:54:00 +00:00
steps:
2023-05-29 00:44:08 +00:00
- uses: actions/checkout@v3
2022-05-03 05:51:15 +00:00
with:
2023-05-29 00:44:08 +00:00
fetch-depth: 0
2021-07-18 15:54:00 +00:00
2023-05-29 00:44:08 +00:00
- name: Setup Node
uses: actions/setup-node@v3
2021-07-18 15:54:00 +00:00
with:
2023-06-07 17:52:53 +00:00
node-version: 18
2021-07-18 15:54:00 +00:00
2023-05-29 00:44:08 +00:00
- name: Cache dependencies
uses: actions/cache@v3
2021-07-18 15:54:00 +00:00
with:
2023-05-29 00:44:08 +00:00
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
2021-07-18 15:54:00 +00:00
2023-05-29 00:44:08 +00:00
- run: npm ci
2023-07-23 00:42:13 +00:00
2023-07-23 00:39:10 +00:00
- name: Check types and style
2023-07-23 00:42:13 +00:00
run: npm run check
2023-05-29 00:44:08 +00:00
2023-07-13 07:19:35 +00:00
- name: Test
run: npm test
2021-07-18 15:54:00 +00:00
2023-07-13 07:19:35 +00:00
- name: Ensure Quartz builds
2023-07-23 00:27:41 +00:00
run: npx quartz build
2023-08-21 11:10:52 +00:00
build:
runs-on: ubuntu-latest
# needs: build-and-test
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- run: git config --global core.quotepath false
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm i
- run: npx quartz build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url}}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2