ci: lint CI
This commit is contained in:
@@ -11,36 +11,47 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Build"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/oven-sh/setup-bun@v2
|
||||
- name: Setup Bun
|
||||
uses: https://github.com/oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
- uses: actions/checkout@v6
|
||||
- run: bun ci
|
||||
- uses: actions/checkout@v6
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
run: bun ci
|
||||
- name: Checkout articles repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: ${{ vars.ARTICLES_REPOSITORY }}
|
||||
ref: main
|
||||
token: ${{ secrets.PRIVATE_CLONE_TOKEN }}
|
||||
path: ./articles
|
||||
- run: bun run build
|
||||
- uses: actions/upload-artifact@v3
|
||||
- name: Build project
|
||||
run: bun run build
|
||||
- name: Upload production files
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: production-files
|
||||
path: dist/
|
||||
|
||||
deploy:
|
||||
stapler:
|
||||
name: "Deploy to Stapler"
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: ${{ vars.STAPLER_TARGET != '' }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
- name: Download production files
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: production-files
|
||||
path: ./dist
|
||||
- run: tar -czC dist -f dist.tar.gz .
|
||||
- run: |
|
||||
- name: Compress production files
|
||||
run: tar -czC dist -f dist.tar.gz .
|
||||
- name: Upload to Stapler server
|
||||
run: |
|
||||
curl -s -X PUT --data-binary "@dist.tar.gz" \
|
||||
-H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \
|
||||
${{ 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
|
||||
|
||||
## Minimal setup
|
||||
@@ -25,4 +27,4 @@ bun run build
|
||||
- [ ] archive page
|
||||
- [x] about page
|
||||
- [ ] link to previous/next article
|
||||
- [ ] proper docs
|
||||
- [ ] proper docs
|
||||
|
||||
Reference in New Issue
Block a user