optimized bee-dashboard build
All checks were successful
CI / Build & deploy Cloudflare page (push) Successful in 2m43s

This commit is contained in:
2025-12-12 21:33:11 +08:00
parent 022fa66288
commit 148e35bbef
2 changed files with 17 additions and 29 deletions

View File

@@ -7,7 +7,7 @@ on:
- '.gitea/workflows/build-bee-dashboard.yaml'
jobs:
"Build & deploy Cloudflare page":
runs-on: hostinger
runs-on: woryzen
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -19,37 +19,30 @@ jobs:
run: cd src && npm install
- name: Copy _headers file
run: cp docker-images/bee-dashboard/_headers src/build
- name: Deploy to Cloudflare
run: npx wrangler pages deploy --project-name bee-dashboard --branch main src/build
env:
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
"Build bee-dashboard docker images":
runs-on: woryzen
steps:
-
name: Set up Docker Buildx
- name: Create archive
run: tar -czf docker-images/bee-dashboard/bee-dashboard.tar -C src/build .
- name: Publish archive to gitea.woggioni.net
run: curl --user woggioni:${{ secrets.PUBLISHER_TOKEN }} --upload-file docker-images/bee-dashboard/bee-dashboard.tar https://gitea.woggioni.net/api/packages/woggioni/generic/bee-dashboard/0.33.3/bee-dashboard.tar
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.4.0
with:
driver: docker-container
platforms: |
linux/amd64
linux/arm64
-
name: Login to Gitea container registry
- name: Login to Gitea container registry
uses: docker/login-action@v3
with:
registry: gitea.woggioni.net
username: woggioni
password: ${{ secrets.PUBLISHER_TOKEN }}
-
name: Build and push bee-dashboard images
- name: Build and push bee-dashboard images
uses: docker/build-push-action@v6
with:
platforms: |
linux/amd64
linux/arm64
context: "{{defaultContext}}:bee-dashboard"
context: "docker-images/bee-dashboard"
push: true
pull: true
ssh: default=/home/luser/.ssh/id_ed25519
@@ -58,3 +51,8 @@ jobs:
"gitea.woggioni.net/woggioni/bee-dashboard:0.33.3"
cache-from: type=registry,ref=gitea.woggioni.net/woggioni/bee-dashboard:buildx
cache-to: type=registry,mode=max,compression=zstd,image-manifest=true,oci-mediatypes=true,ref=gitea.woggioni.net/woggioni/bee-dashboard:buildx
- name: Deploy to Cloudflare
run: npx wrangler pages deploy --project-name bee-dashboard --branch main src/build
env:
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

View File

@@ -1,14 +1,4 @@
FROM alpine:3.22 AS base
RUN --mount=type=cache,target=/var/cache/apk apk add nodejs npm
FROM base AS build
ARG VERSION
RUN --mount=type=cache,target=/var/cache/apk apk add chromium
WORKDIR /src
#ADD git@github.com:ethersphere/bee-dashboard.git#v${VERSION} .
ADD git@github.com:woggioni/bee-dashboard.git#${VERSION} .
RUN PUPPETEER_SKIP_DOWNLOAD=1 npm install
FROM gitea.woggioni.net/woggioni/nginx:v1.29.3 AS final
COPY --from=build /src/build /srv/http
FROM gitea.woggioni.net/woggioni/nginx:v1.29.3
RUN mkdir /srv/http
RUN --mount=type=bind,source=bee-dashboard.tar,target=/bee-dashboard.tar tar -xf /bee-dashboard.tar -C /srv/http
COPY bee-dashboard.conf /etc/nginx/conf.d/bee-dashboard.conf