Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2606d16e
authored
Oct 11, 2025
by
Seefs
Committed by
GitHub
Oct 11, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alpha CI (#2011)
parent
e6129bec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
22 deletions
+113
-22
.github/workflows/docker-image-alpha.yml
+108
-19
Dockerfile
+5
-3
No files found.
.github/workflows/docker-image-alpha.yml
View file @
2606d16e
...
@@ -11,19 +11,42 @@ on:
...
@@ -11,19 +11,42 @@ on:
required
:
false
required
:
false
jobs
:
jobs
:
push_to_registries
:
build_single_arch
:
name
:
Push Docker image to multiple registries
name
:
Build & push (${{ matrix.arch }}) [native]
runs-on
:
ubuntu-latest
strategy
:
fail-fast
:
false
matrix
:
include
:
-
arch
:
amd64
platform
:
linux/amd64
runner
:
ubuntu-latest
-
arch
:
arm64
platform
:
linux/arm64
runner
:
ubuntu-24.04-arm
runs-on
:
${{ matrix.runner }}
permissions
:
permissions
:
packages
:
write
packages
:
write
contents
:
read
contents
:
read
steps
:
steps
:
-
name
:
Check out
the repo
-
name
:
Check out
(shallow)
uses
:
actions/checkout@v4
uses
:
actions/checkout@v4
with
:
fetch-depth
:
1
-
name
:
Save version info
-
name
:
Determine alpha version
id
:
version
run
:
|
run
:
|
echo "alpha-$(date +'%Y%m%d')-$(git rev-parse --short HEAD)" > VERSION
VERSION="alpha-$(date +'%Y%m%d')-$(git rev-parse --short HEAD)"
echo "$VERSION" > VERSION
echo "value=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Publishing version: $VERSION for ${{ matrix.arch }}"
-
name
:
Normalize GHCR repository
run
:
echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
-
name
:
Set up Docker Buildx
uses
:
docker/setup-buildx-action@v3
-
name
:
Log in to Docker Hub
-
name
:
Log in to Docker Hub
uses
:
docker/login-action@v3
uses
:
docker/login-action@v3
...
@@ -31,32 +54,98 @@ jobs:
...
@@ -31,32 +54,98 @@ jobs:
username
:
${{ secrets.DOCKERHUB_USERNAME }}
username
:
${{ secrets.DOCKERHUB_USERNAME }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
-
name
:
Log in to
the Container registry
-
name
:
Log in to
GHCR
uses
:
docker/login-action@v3
uses
:
docker/login-action@v3
with
:
with
:
registry
:
ghcr.io
registry
:
ghcr.io
username
:
${{ github.actor }}
username
:
${{ github.actor }}
password
:
${{ secrets.GITHUB_TOKEN }}
password
:
${{ secrets.GITHUB_TOKEN }}
-
name
:
Set up Docker Buildx
-
name
:
Extract metadata (labels)
uses
:
docker/setup-buildx-action@v3
-
name
:
Extract metadata (tags, labels) for Docker
id
:
meta
id
:
meta
uses
:
docker/metadata-action@v5
uses
:
docker/metadata-action@v5
with
:
with
:
images
:
|
images
:
|
calciumion/new-api
calciumion/new-api
ghcr.io/${{ github.repository }}
ghcr.io/${{ env.GHCR_REPOSITORY }}
tags
:
|
type=raw,value=alpha
type=raw,value=alpha-{{date 'YYYYMMDD'}}-{{sha}}
-
name
:
Build
and push Docker images
-
name
:
Build
& push single-arch (to both registries)
uses
:
docker/build-push-action@v
5
uses
:
docker/build-push-action@v
6
with
:
with
:
context
:
.
context
:
.
platforms
:
linux/amd64,linux/arm64
platforms
:
${{ matrix.platform }}
push
:
true
push
:
true
tags
:
${{ steps.meta.outputs.tags }}
tags
:
|
calciumion/new-api:alpha-${{ matrix.arch }}
calciumion/new-api:${{ steps.version.outputs.value }}-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:alpha-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ steps.version.outputs.value }}-${{ matrix.arch }}
labels
:
${{ steps.meta.outputs.labels }}
labels
:
${{ steps.meta.outputs.labels }}
cache-from
:
type=gha
cache-to
:
type=gha,mode=max
provenance
:
false
sbom
:
false
create_manifests
:
name
:
Create multi-arch manifests (Docker Hub + GHCR)
needs
:
[
build_single_arch
]
runs-on
:
ubuntu-latest
permissions
:
packages
:
write
contents
:
read
steps
:
-
name
:
Check out (shallow)
uses
:
actions/checkout@v4
with
:
fetch-depth
:
1
-
name
:
Normalize GHCR repository
run
:
echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
-
name
:
Determine alpha version
id
:
version
run
:
|
VERSION="alpha-$(date +'%Y%m%d')-$(git rev-parse --short HEAD)"
echo "value=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
-
name
:
Log in to Docker Hub
uses
:
docker/login-action@v3
with
:
username
:
${{ secrets.DOCKERHUB_USERNAME }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
-
name
:
Create & push manifest (Docker Hub - alpha)
run
:
|
docker buildx imagetools create \
-t calciumion/new-api:alpha \
calciumion/new-api:alpha-amd64 \
calciumion/new-api:alpha-arm64
-
name
:
Create & push manifest (Docker Hub - versioned alpha)
run
:
|
docker buildx imagetools create \
-t calciumion/new-api:${VERSION} \
calciumion/new-api:${VERSION}-amd64 \
calciumion/new-api:${VERSION}-arm64
-
name
:
Log in to GHCR
uses
:
docker/login-action@v3
with
:
registry
:
ghcr.io
username
:
${{ github.actor }}
password
:
${{ secrets.GITHUB_TOKEN }}
-
name
:
Create & push manifest (GHCR - alpha)
run
:
|
docker buildx imagetools create \
-t ghcr.io/${GHCR_REPOSITORY}:alpha \
ghcr.io/${GHCR_REPOSITORY}:alpha-amd64 \
ghcr.io/${GHCR_REPOSITORY}:alpha-arm64
-
name
:
Create & push manifest (GHCR - versioned alpha)
run
:
|
docker buildx imagetools create \
-t ghcr.io/${GHCR_REPOSITORY}:${VERSION} \
ghcr.io/${GHCR_REPOSITORY}:${VERSION}-amd64 \
ghcr.io/${GHCR_REPOSITORY}:${VERSION}-arm64
Dockerfile
View file @
2606d16e
...
@@ -9,10 +9,12 @@ COPY ./VERSION .
...
@@ -9,10 +9,12 @@ COPY ./VERSION .
RUN
DISABLE_ESLINT_PLUGIN
=
'true'
VITE_REACT_APP_VERSION
=
$(
cat
VERSION
)
bun run build
RUN
DISABLE_ESLINT_PLUGIN
=
'true'
VITE_REACT_APP_VERSION
=
$(
cat
VERSION
)
bun run build
FROM
golang:alpine AS builder2
FROM
golang:alpine AS builder2
ENV
GO111MODULE=on CGO_ENABLED=0
ARG
TARGETOS
ARG
TARGETARCH
ENV
GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64}
ENV
GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux
WORKDIR
/build
WORKDIR
/build
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment