From 02ae6a6a037bda152a027c57a3c578937c222651 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Wed, 4 Sep 2024 23:25:15 +0200 Subject: [PATCH] feat: moved to gitea workflows for CI/CD Signed-off-by: Louis Vallat --- .gitea/workflows/build_and_deploy.yml | 28 +++++++++++++++++++++++++++ .gitlab-ci.yml | 21 -------------------- 2 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 .gitea/workflows/build_and_deploy.yml delete mode 100644 .gitlab-ci.yml diff --git a/.gitea/workflows/build_and_deploy.yml b/.gitea/workflows/build_and_deploy.yml new file mode 100644 index 0000000..471c996 --- /dev/null +++ b/.gitea/workflows/build_and_deploy.yml @@ -0,0 +1,28 @@ +name: Build and deploy blog +on: + push: + branches: + - master + + +jobs: + Build-and-deploy: + runs-on: alpine + steps: + - name: Install dependencies + run: | + apk add git openssh zola rsync + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: Build blog + run: | + zola build + - name: Deploy blog using rsync + run: | + eval $(ssh-agent -s) + echo "${{ secrets.SSH_PRIVATE_KEY }}" | tr -d '\r' | ssh-add - + mkdir -p ~/.ssh + chmod 700 ~/.ssh + rsync -e "ssh -o StrictHostKeyChecking=no -p ${{ secrets.SSH_PORT }}" -rvz ./public/ ${{ secrets.SSH_DESTINATION }}:/var/www/blog.louis-vallat.dev/ --delete \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 02d627f..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ -image: alpine - -variables: - GIT_SUBMODULE_STRATEGY: recursive - -stages: - - deploy - -deploy: - stage: deploy - before_script: - - apk add openssh zola rsync - - eval $(ssh-agent -s) - - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - script: - - zola build - - rsync -e "ssh -o StrictHostKeyChecking=no -p $SSH_PORT" -rvz ./public/ $SSH_DESTINATION:/var/www/blog.louis-vallat.dev/ --delete - only: - - master