Skip to content

Commit 855c63c

Browse files
Add container image and builds (#32)
1 parent d1a493f commit 855c63c

5 files changed

Lines changed: 72 additions & 26 deletions

File tree

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
.git
3+
*.md
4+
docs/

.github/workflows/ci.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,33 @@ jobs:
2323
cache: 'npm'
2424

2525
- name: Install dependencies
26-
run: npm install
26+
run: npm install
2727

2828
- name: Run tests
2929
run: npm test
30+
31+
build:
32+
name: Build
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
37+
38+
- name: Setup Node.js
39+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
40+
with:
41+
node-version: '24'
42+
cache: 'npm'
43+
44+
- name: Install dependencies
45+
run: npm install
46+
47+
- name: Build plugin
48+
run: npm run build
49+
50+
- name: Upload build artifact
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: plugin-dist
54+
path: dist/
55+
retention-days: 1
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Docker Build
2+
3+
on:
4+
workflow_run:
5+
workflows: [CI]
6+
types: [completed]
7+
8+
jobs:
9+
docker-build:
10+
name: Docker Build
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
17+
with:
18+
ref: ${{ github.event.workflow_run.head_sha }}
19+
20+
- name: Download build artifact
21+
uses: actions/download-artifact@v4
22+
with:
23+
name: plugin-dist
24+
path: dist/
25+
run-id: ${{ github.event.workflow_run.id }}
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Build Docker image
32+
uses: docker/build-push-action@v6
33+
with:
34+
context: .
35+
push: false
36+
tags: headlamp-cloudnativepg:${{ github.event.workflow_run.head_sha }}

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM cgr.dev/chainguard/static:latest
2+
3+
COPY dist/ /plugins/headlamp-cloudnativepg/
4+
5+
USER 1001

dist/main.js

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

0 commit comments

Comments
 (0)