79 lines
2.8 KiB
YAML
79 lines
2.8 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
paths:
|
|
- 'bee-dashboard/**'
|
|
- '.gitea/workflows/build-bee-dashboard.yaml'
|
|
jobs:
|
|
node-build:
|
|
runs-on: hostinger
|
|
container:
|
|
image: gitea.woggioni.net/woggioni/gitea-runner/pnpm:latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v6
|
|
with:
|
|
path: docker-images
|
|
- name: Checkout bee-dashboard sources
|
|
run: git clone -b v0.35.1 --depth 1 https://gitea.woggioni.net/woggioni/bee-dashboard.git src
|
|
- name: Prepare build
|
|
run: pnpm install --frozen-lockfile
|
|
working-directory: ./src
|
|
- name: Execute build
|
|
run: pnpm run build
|
|
working-directory: ./src
|
|
- name: Copy _headers file
|
|
run: cp docker-images/bee-dashboard/_headers src/build
|
|
- name: Create archive
|
|
run: tar -czf docker-images/bee-dashboard/bee-dashboard.tar -C src/build .
|
|
- name: Upload folder as artifact
|
|
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
|
with:
|
|
name: build-artifact
|
|
path: docker-images/bee-dashboard/bee-dashboard.tar
|
|
# - 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.35.1/bee-dashboard.tar
|
|
docker-build:
|
|
runs-on: hostinger
|
|
needs: node-build
|
|
steps:
|
|
- name: Login to Gitea container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.woggioni.net
|
|
username: woggioni
|
|
password: ${{ secrets.PUBLISHER_TOKEN }}
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: build.artifact
|
|
path: docker-images/bee-dashboard/bee-dashboard.tar
|
|
- name: Build and push bee-dashboard images
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: "docker-images/bee-dashboard"
|
|
builder: multiplatform-builder
|
|
platforms: |
|
|
linux/amd64
|
|
linux/arm64
|
|
push: true
|
|
pull: true
|
|
build-args: "VERSION=0.35.1"
|
|
tags: |
|
|
"gitea.woggioni.net/woggioni/bee-dashboard:0.35.1"
|
|
deploy:
|
|
runs-on: hostinger
|
|
needs: node-build
|
|
steps:
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: build.artifact
|
|
path: docker-images/bee-dashboard/bee-dashboard.tar
|
|
- 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 }}
|