Skip to content
Snippets Groups Projects
Commit b30c0a97 authored by Louis's avatar Louis :fire:
Browse files

Add gitlab CI config

parent b9e8d74e
No related branches found
No related tags found
No related merge requests found
Pipeline #733 passed with stage
in 9 minutes and 6 seconds
# GitLab CI configuration for building and publishing Docker images
stages:
- build
variables:
# Docker image name based on the GitLab project path
IMAGE_NAME: ${CI_REGISTRY_IMAGE}
# Use Docker BuildKit for better performance
DOCKER_BUILDKIT: 1
# Build arguments
DOCKER_BUILD_ARGS: ""
# Build and publish Docker image when a tag is pushed
build-and-publish:
stage: build
image: docker:latest
services:
- docker:dind
# Only run this job when a tag is pushed
rules:
- if: $CI_COMMIT_TAG
before_script:
# Log in to the GitLab Container Registry
- echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
script:
# Build the Docker image with the tag as version
- docker build --pull ${DOCKER_BUILD_ARGS} -t ${IMAGE_NAME}:${CI_COMMIT_TAG} .
# Push the versioned tag
- docker push ${IMAGE_NAME}:${CI_COMMIT_TAG}
- echo "Docker image '${IMAGE_NAME}:${CI_COMMIT_TAG}' was built and pushed to the registry"
# Cache Docker layers between jobs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .docker-cache/
# Use cimg/android:2025.04-ndk as the base image
FROM cimg/android:2025.04-ndk
USER root
# Set environment variables
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment