Skip to content

Commit 6edd04a

Browse files
committed
feat: initial version
1 parent 56b75da commit 6edd04a

File tree

4 files changed

+109
-1
lines changed

4 files changed

+109
-1
lines changed

Diff for: .github/workflows/build.yaml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Build Portal Images
2+
3+
on:
4+
push:
5+
branches: ['develop']
6+
workflow_dispatch:
7+
inputs:
8+
specific_group:
9+
description: 'Build specific group (empty for all)'
10+
required: false
11+
type: string
12+
13+
jobs:
14+
prepare:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
matrix: ${{ steps.set-matrix.outputs.matrix }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: mikefarah/yq@v4
22+
id: set-matrix
23+
with:
24+
cmd: eval -o=json .groups plugin-groups.yaml
25+
26+
- if: inputs.specific_group != ''
27+
uses: mikefarah/yq@master
28+
id: set-matrix-filtered
29+
with:
30+
cmd: |
31+
eval -o=json ".groups | { \"${{ inputs.specific_group }}\": .\"${{ inputs.specific_group }}\" }" plugin-groups.yaml
32+
33+
- name: Set final matrix
34+
id: set-final-matrix
35+
run: |
36+
if [[ -n "${{ inputs.specific_group }}" ]]; then
37+
echo "matrix=${{ steps.set-matrix-filtered.outputs.result }}" >> $GITHUB_OUTPUT
38+
else
39+
echo "matrix=${{ steps.set-matrix.outputs.result }}" >> $GITHUB_OUTPUT
40+
fi
41+
42+
build:
43+
needs: prepare
44+
runs-on: ubuntu-latest
45+
strategy:
46+
matrix:
47+
include: ${{ fromJSON(needs.prepare.outputs.matrix) }}
48+
permissions:
49+
packages: write
50+
contents: read
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- uses: actions/setup-go@v4
55+
with:
56+
go-version: '1.21'
57+
cache: true
58+
59+
# Cache xportal binary install
60+
- name: Cache xportal
61+
id: cache-xportal
62+
uses: actions/cache@v3
63+
with:
64+
path: ~/go/bin/xportal
65+
key: ${{ runner.os }}-xportal-${{ hashFiles('go.mod', 'go.sum') }}
66+
67+
# Install xportal if not cached
68+
- if: steps.cache-xportal.outputs.cache-hit != 'true'
69+
name: Install xportal
70+
run: go install go.lumeweb.com/xportal/cmd/xportal@latest
71+
72+
# Build portal with plugins and cache dependencies
73+
- name: Build portal
74+
run: |
75+
PLUGINS=$(echo '${{ toJSON(matrix.plugins) }}' | jq -r 'join(" --with ")')
76+
xportal build --with $PLUGINS
77+
78+
- uses: docker/setup-buildx-action@v3
79+
80+
- name: Login to GitHub Container Registry
81+
uses: docker/login-action@v3
82+
with:
83+
registry: ghcr.io
84+
username: ${{ github.actor }}
85+
password: ${{ secrets.GITHUB_TOKEN }}
86+
87+
- name: Build and push Docker image
88+
uses: docker/build-push-action@v5
89+
with:
90+
push: true
91+
context: .
92+
tags: |
93+
ghcr.io/${{ github.repository }}:${{ matrix.group }}
94+
cache-from: type=gha
95+
cache-to: type=gha,mode=max

Diff for: Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM alpine:latest
2+
COPY portal /usr/local/bin/portal
3+
ENTRYPOINT ["/usr/local/bin/portal"]

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Lume Web
3+
Copyright (c) 2024 Hammer Technologies LLC
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: groups.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
groups:
2+
core:
3+
plugins:
4+
base:
5+
plugins:
6+
- go.lumeweb.com/portal-plugin-dashboard@latest
7+
standard:
8+
plugins:
9+
- go.lumeweb.com/portal-plugin-dashboard@latest
10+
- go.lumeweb.com/portal-plugin-ipfs@latest

0 commit comments

Comments
 (0)