ci: lint CI
This commit is contained in:
@@ -11,36 +11,47 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
name: "Build"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/oven-sh/setup-bun@v2
|
- name: Setup Bun
|
||||||
|
uses: https://github.com/oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
bun-version: latest
|
bun-version: latest
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout repository
|
||||||
- run: bun ci
|
uses: actions/checkout@v6
|
||||||
- uses: actions/checkout@v6
|
- name: Install dependencies
|
||||||
|
run: bun ci
|
||||||
|
- name: Checkout articles repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
repository: ${{ vars.ARTICLES_REPOSITORY }}
|
repository: ${{ vars.ARTICLES_REPOSITORY }}
|
||||||
ref: main
|
ref: main
|
||||||
token: ${{ secrets.PRIVATE_CLONE_TOKEN }}
|
token: ${{ secrets.PRIVATE_CLONE_TOKEN }}
|
||||||
path: ./articles
|
path: ./articles
|
||||||
- run: bun run build
|
- name: Build project
|
||||||
- uses: actions/upload-artifact@v3
|
run: bun run build
|
||||||
|
- name: Upload production files
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: production-files
|
name: production-files
|
||||||
path: dist/
|
path: dist/
|
||||||
|
|
||||||
deploy:
|
stapler:
|
||||||
|
name: "Deploy to Stapler"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: ${{ vars.STAPLER_TARGET != '' }}
|
if: ${{ vars.STAPLER_TARGET != '' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v3
|
- name: Download production files
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: production-files
|
name: production-files
|
||||||
path: ./dist
|
path: ./dist
|
||||||
- run: tar -czC dist -f dist.tar.gz .
|
- name: Compress production files
|
||||||
- run: |
|
run: tar -czC dist -f dist.tar.gz .
|
||||||
|
- name: Upload to Stapler server
|
||||||
|
run: |
|
||||||
curl -s -X PUT --data-binary "@dist.tar.gz" \
|
curl -s -X PUT --data-binary "@dist.tar.gz" \
|
||||||
-H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \
|
-H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \
|
||||||
${{ vars.STAPLER_CURL_ARGS }} \
|
${{ vars.STAPLER_CURL_ARGS }} \
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
name: Lint
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: lint-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on: [push, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-eslint:
|
||||||
|
name: 'ESLint'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: https://github.com/oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun ci
|
||||||
|
- name: Create fake articles
|
||||||
|
run: mv articles.example articles
|
||||||
|
- name: Run ESLint
|
||||||
|
run: bun run lint:eslint
|
||||||
|
|
||||||
|
lint-oxlint:
|
||||||
|
name: 'Oxlint'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: https://github.com/oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun ci
|
||||||
|
- name: Create fake articles
|
||||||
|
run: mv articles.example articles
|
||||||
|
- name: Run Oxlint
|
||||||
|
run: bun run lint:oxlint
|
||||||
|
|
||||||
|
type-check:
|
||||||
|
name: Type Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: https://github.com/oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun ci
|
||||||
|
- name: Create fake articles
|
||||||
|
run: mv articles.example articles
|
||||||
|
- name: Run type check
|
||||||
|
run: bun run type-check
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
[](https://git.klemek.fr/klemek/md-blog/actions?workflow=lint.yml) [](https://git.klemek.fr/klemek/md-blog/actions?workflow=deploy.yml)
|
||||||
|
|
||||||
# md-blog
|
# md-blog
|
||||||
|
|
||||||
## Minimal setup
|
## Minimal setup
|
||||||
|
|||||||
Reference in New Issue
Block a user