diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 63e220b..b08b79f 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -49,13 +49,20 @@ jobs: exit 1 fi echo "VERSION=$version" >> "$GITHUB_ENV" - echo "IMAGE=k3crpi.jumpingcrab.com:5000/sabisan:$version" >> "$GITHUB_ENV" + echo "IMAGE_AMD64=k3crpi.jumpingcrab.com:5000/sabisan_amd64:$version" >> "$GITHUB_ENV" + echo "IMAGE_ARM64=k3crpi.jumpingcrab.com:5000/sabisan_arm64:$version" >> "$GITHUB_ENV" - name: Install Docker CLI run: | apt-get update - apt-get install -y --no-install-recommends docker.io + apt-get install -y --no-install-recommends ca-certificates curl docker.io rm -rf /var/lib/apt/lists/* + mkdir -p ~/.docker/cli-plugins + curl -fsSL \ + https://github.com/docker/buildx/releases/download/v0.19.3/buildx-v0.19.3.linux-amd64 \ + -o ~/.docker/cli-plugins/docker-buildx + chmod +x ~/.docker/cli-plugins/docker-buildx + docker buildx version - name: Log in to registry run: | @@ -63,8 +70,23 @@ jobs: --username "${{ secrets.REGISTRY_USERNAME }}" \ --password-stdin - - name: Build image - run: docker build --pull --tag "$IMAGE" . + - name: Create Buildx builder + run: docker buildx create --use --name sabisan-builder - - name: Push image - run: docker push "$IMAGE" + - name: Build and push amd64 image + run: | + docker buildx build \ + --platform linux/amd64 \ + --pull \ + --tag "$IMAGE_AMD64" \ + --push \ + . + + - name: Build and push arm64 image + run: | + docker buildx build \ + --platform linux/arm64 \ + --pull \ + --tag "$IMAGE_ARM64" \ + --push \ + . diff --git a/.gitignore b/.gitignore index 46b2cc9..c5966ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /.env /.env.* !/.env.example +infra/ data/*.db data/*.db-* data/uploads/*