diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..3999cfc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + groups: + all-github-actions: + patterns: + - "*" + schedule: + interval: "monthly" + day: "monday" + time: "08:30" + timezone: "Europe/Vienna" + open-pull-requests-limit: 5 + labels: + - "dependencies" + - "github-actions" + assignees: + - "cleot" # devops \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index beee703..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: ['v22.11.0'] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Node.js (${{ matrix.node-version }}) - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run lint - - - name: Run tests and generate coverage - run: npm run test -- --coverage - - - name: Build - run: npm run build - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bd1a5f2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: ["master", "dev"] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + validate: + name: Validate (lint, test, build) + runs-on: ubuntu-latest + env: + NODE_VERSION: 22 + + steps: + - name: Checkout code + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + + - name: Set up Node.js (${{ env.NODE_VERSION }}) + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Run tests and generate coverage + run: npm run test -- --coverage + + - name: Build + run: npm run build + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..3565be2 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,56 @@ +name: build and push nightly image + +on: + push: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + IMAGE_NAME: "bcr-wdc-dashboard-ui" + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + + - name: Login to GHCR + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + + - id: meta + name: Metadata + uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0 + with: + images: | + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=nightly + + - id: push + name: Build & push ${{ env.IMAGE_NAME }} + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha,scope=${{ github.repository }}/${{ env.IMAGE_NAME }} + cache-to: type=gha,mode=max,scope=${{ github.repository }}/${{ env.IMAGE_NAME }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cb546ea --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +name: release tagged image + +on: + push: + tags: + - "v*.*.*" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + IMAGE_NAME: "bcr-wdc-dashboard-ui" + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + + - name: Login to GHCR + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + + - id: meta + name: Metadata + uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0 + with: + images: | + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + + - id: push + name: Build & push ${{ env.IMAGE_NAME }} + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha,scope=${{ github.repository }}/${{ env.IMAGE_NAME }} + cache-to: type=gha,mode=max,scope=${{ github.repository }}/${{ env.IMAGE_NAME }} \ No newline at end of file