From e6b4d3f0ccdd2e3a89f93cefceba2d1bff0e46f1 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Sun, 8 Sep 2024 18:09:29 +0200 Subject: [PATCH] feat: moved to gitea workflows for CI/CD Signed-off-by: Louis Vallat --- .gitea/workflows/build.yml | 13 +++++++++ .gitlab-ci.yml | 59 -------------------------------------- 2 files changed, 13 insertions(+), 59 deletions(-) create mode 100644 .gitea/workflows/build.yml delete mode 100644 .gitlab-ci.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..2c02689 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,13 @@ +name: "Build Rust binary in release mode" +on: push + +jobs: + build: + name: "Build" + runs-on: rust-bookworm + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Build + run: | + cargo build --release diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index e21031b..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,59 +0,0 @@ -image: docker:latest -services: - - docker:dind - -stages: - - build - - release - - deploy - -# Disable the Gradle daemon for Continuous Integration servers as correctness -# is usually a priority over speed in CI environments. Using a fresh -# runtime for each build is more reliable since the runtime is completely -# isolated from any previous builds. -variables: - # Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled - DOCKER_HOST: tcp://docker:2376 - DOCKER_TLS_CERTDIR: "/certs" - CONTAINER_BRANCH_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG - CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest - -build: - image: rust:1.52 - stage: build - script: cargo build --release - cache: - key: "$CI_COMMIT_REF_NAME" - policy: push - paths: - - build - - .cargo - artifacts: - paths: - - target/release/moviequotebot_api - -release: - stage: release - script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker build . -t $CONTAINER_BRANCH_IMAGE - - docker push $CONTAINER_BRANCH_IMAGE - -release-master: - stage: release - script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker build . -t $CONTAINER_RELEASE_IMAGE - - docker push $CONTAINER_RELEASE_IMAGE - only: - - master - -deploy: - stage: deploy - before_script: - - eval $(ssh-agent -s) - - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - script: - - ssh -o StrictHostKeyChecking=no -p $SSH_PORT $SSH_DESTINATION "cd $PATH_TO_APPLICATION; $UPGRADE_COMMAND;"