feat: add Dockerfile, Gitea Actions CI, and Artifact Hub metadata
Multi-stage Dockerfile produces a lightweight image with the compiled plugin at /plugins/. Gitea Actions workflow triggers on tag push (v*), builds the plugin, pushes to the Gitea container registry, and creates a release with the tarball attached. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: node:20
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build plugin
|
||||||
|
run: npx @kinvolk/headlamp-plugin build
|
||||||
|
|
||||||
|
- name: Package tarball
|
||||||
|
run: npx @kinvolk/headlamp-plugin package
|
||||||
|
|
||||||
|
- name: Install Docker CLI
|
||||||
|
run: apt-get update && apt-get install -y docker.io
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: docker build -t git.farh.net/${{ github.repository }}:${{ github.ref_name }} -t git.farh.net/${{ github.repository }}:latest .
|
||||||
|
|
||||||
|
- name: Push Docker image
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.farh.net -u ${{ github.actor }} --password-stdin
|
||||||
|
docker push git.farh.net/${{ github.repository }}:${{ github.ref_name }}
|
||||||
|
docker push git.farh.net/${{ github.repository }}:latest
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
uses: akkuman/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
*.tar.gz
|
||||||
|
token: ${{ github.token }}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
FROM node:20-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json* ./
|
||||||
|
RUN npm ci --ignore-scripts
|
||||||
|
COPY src/ src/
|
||||||
|
RUN npx @kinvolk/headlamp-plugin build
|
||||||
|
|
||||||
|
FROM alpine:3.20
|
||||||
|
COPY --from=build /app/dist/ /plugins/polaris-headlamp-plugin/
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
repositoryID: polaris-headlamp-plugin
|
||||||
|
owners:
|
||||||
|
- name: farhoodliquor
|
||||||
|
email: ""
|
||||||
Generated
+18152
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "headlamp-plugin start",
|
"start": "headlamp-plugin start",
|
||||||
"build": "headlamp-plugin build",
|
"build": "headlamp-plugin build",
|
||||||
|
"package": "headlamp-plugin package",
|
||||||
"tsc": "tsc --noEmit"
|
"tsc": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user