docker: fixed the missing of platform linux/amd64.

This commit is contained in:
AirryCo
2024-11-26 20:30:47 +08:00
parent c4ee8fb0c5
commit eaf29f59a9
3 changed files with 12 additions and 198 deletions

View File

@@ -299,93 +299,6 @@ jobs:
path: ${{ env.SOURCECODE_DIR }}/project/${{ env.OUTPUT_DIR }}
overwrite: true
# docker
- name: Move .tgz to docker dir
run: |
cd ${{ env.SOURCECODE_DIR }}/project
tar -czf ../docker/spt-server.tgz ${{ env.OUTPUT_DIR }}
ls -l ../docker
shell: bash
- name: Extract metadata for Docker with bem version
if: ${{ contains(needs.prepare.outputs.TARGET_TAG, 'BEM') }}
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_USER }}/${{ env.DOCKERHUB_REPOSITORY }}
ghcr.io/${{ env.GHCR_USER }}/${{ env.GHCR_REPOSITORY }}
registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server
tags: |
type=semver,pattern={{version}},value=${{ needs.prepare.outputs.TARGET_TAG }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.prepare.outputs.TARGET_TAG }}
- name: Extract metadata for Docker with latest version
if: ${{ !contains(needs.prepare.outputs.TARGET_TAG, 'BEM') }}
id: meta-latest
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_USER }}/${{ env.DOCKERHUB_REPOSITORY }}
ghcr.io/${{ env.GHCR_USER }}/${{ env.GHCR_REPOSITORY }}
registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server
tags: |
type=semver,pattern={{version}},value=${{ needs.prepare.outputs.TARGET_TAG }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.prepare.outputs.TARGET_TAG }}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# DockerHub
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# GitHub Container Registry
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
# Aliyun Registry
- name: Login to Aliyun Registry
uses: docker/login-action@v3
with:
registry: registry.cn-shenzhen.aliyuncs.com
username: ${{ secrets.ALIYUN_REGISTRY_USER }}
password: ${{ secrets.ALIYUN_REGISTRY_TOKEN }}
- name: Build and Push For BEM
if: ${{ contains(needs.prepare.outputs.TARGET_TAG, 'BEM') }}
uses: docker/build-push-action@v6
with:
context: ${{ env.SOURCECODE_DIR }}/docker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.source=https://github.com/AirryCo/spt-server
org.opencontainers.image.url=https://github.com/AirryCo/spt-server
org.opencontainers.image.revision=${{ steps.debug-info.outputs.COMMIT_ID_WHOLE }}
platforms: linux/amd64
- name: Build and Push For Latest
if: ${{ !contains(needs.prepare.outputs.TARGET_TAG, 'BEM') }}
uses: docker/build-push-action@v6
with:
context: ${{ env.SOURCECODE_DIR }}/docker
push: true
tags: ${{ steps.meta-latest.outputs.tags }}
labels: |
${{ steps.meta-latest.outputs.labels }}
org.opencontainers.image.source=https://github.com/AirryCo/spt-server
org.opencontainers.image.url=https://github.com/AirryCo/spt-server
org.opencontainers.image.revision=${{ steps.debug-info.outputs.COMMIT_ID_WHOLE }}
platforms: linux/amd64
- name: Push Linux Server Code And Tag
run: |
cd ${{ env.SOURCECODE_DIR }}
@@ -478,7 +391,7 @@ jobs:
org.opencontainers.image.source=https://github.com/AirryCo/spt-server
org.opencontainers.image.url=https://github.com/AirryCo/spt-server
org.opencontainers.image.revision=${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID_WHOLE }}
platforms: linux/arm64
platforms: linux.amd64,linux/arm64
- name: Build and Push For Latest
if: ${{ !contains(needs.prepare.outputs.TARGET_TAG, 'BEM') }}
uses: docker/build-push-action@v6
@@ -491,7 +404,7 @@ jobs:
org.opencontainers.image.source=https://github.com/AirryCo/spt-server
org.opencontainers.image.url=https://github.com/AirryCo/spt-server
org.opencontainers.image.revision=${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID_WHOLE }}
platforms: linux/arm64
platforms: linux.amd64,linux/arm64
assemble-and-publish:
needs: [prepare, build-server-windows, build-server-linux, build-docker-image-multi-arch]