feat: moved to gitea workflows for CI/CD
All checks were successful
Build Rust binary in release mode / build (push) Successful in 50s

Signed-off-by: Louis Vallat <contact@louis-vallat.dev>
This commit is contained in:
Louis Vallat 2024-09-08 13:06:14 +02:00
parent cef4088f6b
commit 2666e471e1
Signed by: louis
SSH Key Fingerprint: SHA256:usb9EA8eIADT+Bt0Ne8ZkISCbgPSOYkVgS2iZqdZj8s
2 changed files with 12 additions and 42 deletions

View File

@ -0,0 +1,12 @@
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 binary
run: cargo build --release

View File

@ -1,42 +0,0 @@
image: docker:latest
services:
- docker:dind
stages:
- release
- deploy
variables:
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
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;"
only:
- master