Skip to content

Commit f7cfedf

Browse files
authored
ci: build and push docker image to GHCR, misc CI improvements (#79)
1 parent f160566 commit f7cfedf

File tree

5 files changed

+174
-40
lines changed

5 files changed

+174
-40
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
groups:
6+
all-github-actions:
7+
patterns:
8+
- "*"
9+
schedule:
10+
interval: "monthly"
11+
day: "monday"
12+
time: "08:30"
13+
timezone: "Europe/Vienna"
14+
open-pull-requests-limit: 5
15+
labels:
16+
- "dependencies"
17+
- "github-actions"
18+
assignees:
19+
- "cleot" # devops

.github/workflows/build.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["master", "dev"]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
validate:
14+
name: Validate (lint, test, build)
15+
runs-on: ubuntu-latest
16+
env:
17+
NODE_VERSION: 22
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
22+
23+
- name: Set up Node.js (${{ env.NODE_VERSION }})
24+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
25+
with:
26+
node-version: ${{ env.NODE_VERSION }}
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Lint
32+
run: npm run lint
33+
34+
- name: Run tests and generate coverage
35+
run: npm run test -- --coverage
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Upload coverage to Codecov
41+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
42+
with:
43+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/nightly.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: build and push nightly image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
IMAGE_NAME: "bcr-wdc-dashboard-ui"
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
25+
26+
- name: Login to GHCR
27+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.repository_owner }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Set up Docker Buildx
34+
id: buildx
35+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
36+
37+
- id: meta
38+
name: Metadata
39+
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
40+
with:
41+
images: |
42+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
43+
tags: |
44+
type=raw,value=nightly
45+
46+
- id: push
47+
name: Build & push ${{ env.IMAGE_NAME }}
48+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
49+
with:
50+
context: .
51+
file: ./Dockerfile
52+
push: true
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
cache-from: type=gha,scope=${{ github.repository }}/${{ env.IMAGE_NAME }}
56+
cache-to: type=gha,mode=max,scope=${{ github.repository }}/${{ env.IMAGE_NAME }}

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: release tagged image
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
IMAGE_NAME: "bcr-wdc-dashboard-ui"
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
25+
26+
- name: Login to GHCR
27+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.repository_owner }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Set up Docker Buildx
34+
id: buildx
35+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
36+
37+
- id: meta
38+
name: Metadata
39+
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
40+
with:
41+
images: |
42+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
43+
tags: |
44+
type=semver,pattern={{version}}
45+
46+
- id: push
47+
name: Build & push ${{ env.IMAGE_NAME }}
48+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
49+
with:
50+
context: .
51+
file: ./Dockerfile
52+
push: true
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
cache-from: type=gha,scope=${{ github.repository }}/${{ env.IMAGE_NAME }}
56+
cache-to: type=gha,mode=max,scope=${{ github.repository }}/${{ env.IMAGE_NAME }}

0 commit comments

Comments
 (0)