Skip to content

Commit

Permalink
ci: support multi platform
Browse files Browse the repository at this point in the history
  • Loading branch information
gitsang committed May 23, 2024
1 parent 89655f9 commit c112b4e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/ci.yml → .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: docker

on:
create:
Expand Down Expand Up @@ -32,15 +32,13 @@ jobs:
VERSION=${{ steps.get_version.outputs.VERSION }}
mkdir -p ${TARGET_PATH} ${TARGET_PATH}/bin ${TARGET_PATH}/conf ${TARGET_PATH}/log
go build \
CGO_ENABLED=0 go build \
-ldflags "-X ddns/pkg/config.Version=${VERSION}" \
-o ${TARGET_PATH}/bin/${SERVICE_NAME} cmd/${SERVICE_NAME}.go
cp configs/template.yml ${TARGET_PATH}/conf
docker build -f Dockerfile --no-cache \
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v6/linux/arm/v7,linux/arm/v8 \
-f Dockerfile --no-cache \
--build-arg DOCKER_PACKAGE_PATH=${TARGET_PATH} \
-t ${DOCKER_REPO}/${SERVICE_NAME}:${VERSION} .
docker tag ${DOCKER_REPO}/${SERVICE_NAME}:${VERSION} ${DOCKER_REPO}/${SERVICE_NAME}:latest
docker push ${DOCKER_REPO}/${SERVICE_NAME}:${VERSION}
docker push ${DOCKER_REPO}/${SERVICE_NAME}:latest
-t ${DOCKER_REPO}/${SERVICE_NAME}:${VERSION} \
--push .

0 comments on commit c112b4e

Please sign in to comment.