Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

51 changes: 0 additions & 51 deletions .eslintrc.js

This file was deleted.

60 changes: 22 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
name: Lint & test & build
name: Build

on:
push:
branches: ["main"]
# Github Actions don't support YAML anchors yet, so we have to repeat
# the paths-ignore in both push and pull_request events.
# More info: https://github.com/actions/runner/issues/1182
paths-ignore:
- "public/**"
- ".husky/**"
- ".vscode/**"
- "*.html"
- ".nvmrc"
- ".prettierignore"
- ".prettierrc"
- "Dockerfile"
- "LICENSE"
- "nginx.conf.template"
- "README.md"
pull_request:
branches: ["main"]
paths-ignore:
- "public/**"
- ".husky/**"
- ".vscode/**"
- "*.html"
- ".nvmrc"
- ".prettierignore"
- ".prettierrc"
- "Dockerfile"
- "LICENSE"
- "nginx.conf.template"
- "README.md"
workflow_call:
inputs:
platform:
type: string
required: true
outputs:
dist-filename:
value: ${{ jobs.build.outputs.dist-filename }}

jobs:
build:
runs-on: ubuntu-latest
outputs:
dist-filename: ${{ steps.get-dist-filename.outputs.dist_filename }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -55,12 +34,17 @@ jobs:
- if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

- run: npm run lint
- run: npm run test -- --bail
- run: npm run build:prod
- run: npm run build:prod:${{ inputs.platform }}

- name: Upload build artifact
- name: Get distributive filename
id: get-dist-filename
run: |
FILENAME=$(ls dist/dist-*.zip | head -n 1 | xargs basename)
echo "DIST_FILENAME=$FILENAME" >> $GITHUB_ENV
echo "dist_filename=$FILENAME" >> $GITHUB_OUTPUT

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
name: ${{ env.DIST_FILENAME }}
path: dist/${{ env.DIST_FILENAME }}
1 change: 0 additions & 1 deletion .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
jobs:
bump:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build & push Docker image

on:
workflow_call:
inputs:
dist-artifact-name:
type: string
required: true
push:
type: boolean
required: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.dist-artifact-name }}
- run: |
mkdir -p dist
unzip -q ${{ inputs.dist-artifact-name }} -d dist

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }}
password: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }}

- name: Docker meta
id: metadata
uses: docker/metadata-action@v5
with:
images: digmaai/digma-ui
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=match,pattern=v(.*),group=1
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# set latest tag for main branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}

- name: Build and push
if: ${{ inputs.push == 'true' }}
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ inputs.push }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
32 changes: 32 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint & test

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
id: setup-node
with:
node-version-file: ".nvmrc"
cache: "npm"

- id: node-modules-cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-node_modules-

- if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Lint
run: npm run lint

- name: Test
run: npm run test -- --bail
54 changes: 54 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Lint & test & build

on:
push:
branches: ["main"]
# Github Actions don't support YAML anchors yet, so we have to repeat
# the paths-ignore in both push and pull_request events.
# More info: https://github.com/actions/runner/issues/1182
paths-ignore:
- ".husky/**"
- ".vscode/**"
- "website/**"
- ".prettierignore"
- ".prettierrc"
- "LICENSE"
- "README.md"
pull_request:
branches: ["main"]
paths-ignore:
- ".husky/**"
- ".vscode/**"
- "website/**"
- ".prettierignore"
- ".prettierrc"
- "LICENSE"
- "README.md"

jobs:
lint-test:
name: Lint & test
uses: ./.github/workflows/lint-test.yml

build-jetbrains:
name: Build for JetBrains
needs: lint-test
uses: ./.github/workflows/build.yml
with:
platform: "jetbrains"

build-web:
name: Build for web
needs: lint-test
uses: ./.github/workflows/build.yml
with:
platform: "web"

build-test-docker-image:
name: Build Docker image
needs: [build-jetbrains, build-web]
uses: ./.github/workflows/docker-image.yml
secrets: inherit
with:
dist-artifact-name: ${{ needs.build-web.outputs.dist-filename }}
push: false
25 changes: 25 additions & 0 deletions .github/workflows/release-asset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Attach artifact to release

on:
workflow_call:
inputs:
artifact-name:
type: string
required: true

permissions:
contents: write

jobs:
attach:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}

- uses: softprops/action-gh-release@v2
with:
files: ${{ inputs.artifact-name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading