Skip to content

Commit

Permalink
ci-cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaile committed Oct 23, 2023
1 parent d062a77 commit 31978e2
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 15 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build

on:
push:
pull_request:
workflow_dispatch:

jobs:
ui:
name: UI
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: |
./build.sh
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist-${{ github.sha }}
path: dist
retention-days: 7
28 changes: 28 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Linters

on:
pull_request:
workflow_dispatch:

jobs:
prettier:
name: Prettier
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-setup@v1
- name: Run prettier
run: |
./dev.sh npm ci
./dev.sh npm run format | reviewdog -f=diff -reporter=github-pr-check
eslint:
name: Eslint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-setup@v1
- name: Run eslint
run: |
./dev.sh npm ci
./dev.sh npm run lint:check -- -f checkstyle | reviewdog -f=checkstyle -reporter=github-pr-check
8 changes: 0 additions & 8 deletions .vscode/extensions.json

This file was deleted.

4 changes: 2 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ COPY package-lock.json .
RUN npm ci
COPY public public
COPY src src
COPY .postcssrc.json .
COPY env.d.ts .
COPY index.html .
COPY tailwind.config.ts .
COPY tsconfig.app.json .
COPY tsconfig.json .
COPY tsconfig.node.json .
COPY tsconfig.vitest.json .
COPY vite.config.ts .
COPY vitest.config.ts .
RUN npm run build

FROM docker.io/nginx:stable-alpine-slim as prod
Expand Down
Empty file modified build.sh
100644 → 100755
Empty file.
18 changes: 14 additions & 4 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,28 @@ build_image() {
podman build \
--force-rm \
--layers \
--target dev \
--tag "${dev_image}" \
--target "$1" \
--tag "$2" \
.
}

if [ "$1" = "build" ]; then
build_image
build_image "dev" "$dev_image"
exit 0
fi

if [ "$1" = "prod" ]; then
build_image "prod" "$dev_image:prod"
podman run \
--rm \
--publish 8080:80 \
"$dev_image:prod"
exit 0
fi


if ! podman image exists "$dev_image"; then
build_image
build_image "dev" "$dev_image"
fi

# params given will be appended at the end of the command
Expand Down
2 changes: 1 addition & 1 deletion src/assets/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;

0 comments on commit 31978e2

Please sign in to comment.