libretranslate-api/.gitlab-ci.yml

37 lines
1.4 KiB
YAML
Raw Normal View History

2024-04-18 17:47:30 +02:00
image: docker:dind
services:
- docker:dind
2024-06-20 00:37:02 +02:00
stages:
- build_amd64
- build_arm64
2024-04-18 17:47:30 +02:00
before_script:
- docker -v
2024-06-20 00:37:02 +02:00
build_amd64:
2024-06-20 00:42:23 +02:00
stage: build_amd64
2024-06-20 01:08:56 +02:00
needs: []
2024-04-18 17:53:05 +02:00
before_script:
- git submodule update --init --recursive
2024-04-18 17:47:30 +02:00
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
2024-07-05 14:28:13 +02:00
- docker buildx build --build-arg "with_models=true" -t libretranslate:amd64 -f LibreTranslate/docker/Dockerfile LibreTranslate/
2024-06-20 12:13:53 +02:00
- docker tag libretranslate:amd64 $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api:amd64
- docker tag libretranslate:amd64 $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api:latest
- docker push $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api:amd64
2024-04-18 17:47:30 +02:00
- docker push $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api:latest
2024-06-20 00:37:02 +02:00
build_arm64:
2024-06-20 00:42:23 +02:00
stage: build_arm64
2024-06-20 01:08:56 +02:00
needs: []
2024-06-20 00:37:02 +02:00
before_script:
- git submodule update --init --recursive
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
2024-07-05 14:28:13 +02:00
- docker buildx build --platform arm64 --build-arg "with_models=true" -t libretranslate:arm64 -f LibreTranslate/docker/arm.Dockerfile LibreTranslate/
2024-06-20 01:08:56 +02:00
- docker tag libretranslate:arm64 $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api:arm64
- docker push $CI_REGISTRY/manalejandro/libretranslate-api/libretranslate-api:arm64