From 4ffc3640d0b314e408dad00dbab7ea114f8d035b Mon Sep 17 00:00:00 2001 From: Shahrad Elahi Date: Mon, 8 Jan 2024 13:22:33 +0330 Subject: [PATCH] chore: add gh action for lint and fix format with prettier --- .github/workflows/lint.yml | 49 ++++++++++++++++++++++++ web/.prettierignore | 1 + web/src/routes/CreateServerDialog.svelte | 10 +++-- web/src/routes/[serverId]/+page.svelte | 1 - 4 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..ecda55e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + packages: write + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - run: pnpm install + - run: pnpm lint + + ghcr-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.PRIVATE_TOKEN }} + + - name: Build image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: false diff --git a/web/.prettierignore b/web/.prettierignore index 3897265..5aaf0e3 100644 --- a/web/.prettierignore +++ b/web/.prettierignore @@ -6,6 +6,7 @@ node_modules .env .env.* !.env.example +src/lib/assets # Ignore files for PNPM, NPM and YARN pnpm-lock.yaml diff --git a/web/src/routes/CreateServerDialog.svelte b/web/src/routes/CreateServerDialog.svelte index c37b7bc..769e67f 100644 --- a/web/src/routes/CreateServerDialog.svelte +++ b/web/src/routes/CreateServerDialog.svelte @@ -21,7 +21,11 @@ } from '$lib/components/ui/form'; import { FormItem } from '$lib/components/ui/form/index.js'; import { cn } from '$lib/utils'; - import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '$lib/components/ui/collapsible'; + import { + Collapsible, + CollapsibleContent, + CollapsibleTrigger, + } from '$lib/components/ui/collapsible'; import { Button } from '$lib/components/ui/button'; import toast from 'svelte-french-toast'; @@ -88,7 +92,7 @@ Port This is the port that the WireGuard server will listen on.This is the port that the WireGuard server will listen on. @@ -118,7 +122,7 @@ DNS Optional. This is the DNS server that will be pushed to clients.Optional. This is the DNS server that will be pushed to clients. diff --git a/web/src/routes/[serverId]/+page.svelte b/web/src/routes/[serverId]/+page.svelte index f28f348..614419e 100644 --- a/web/src/routes/[serverId]/+page.svelte +++ b/web/src/routes/[serverId]/+page.svelte @@ -81,7 +81,6 @@ onDestroy(() => { clearInterval(interval); }); -