diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5af282f..f30c309 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 }} \ diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..812b8b9 --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 diff --git a/README.md b/README.md index 41d22a9..ee089bf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![](https://git.klemek.fr/klemek/md-blog/actions/workflows/lint.yml/badge.svg?branch=main&style=flat-square)](https://git.klemek.fr/klemek/md-blog/actions?workflow=lint.yml) [![](https://git.klemek.fr/klemek/md-blog/actions/workflows/deploy.yml/badge.svg?branch=main&style=flat-square)](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 \ No newline at end of file +- [ ] proper docs