From 867e811d375b90e59bfd79bd83b2c22af360172f Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Sat, 2 May 2026 14:20:04 +0200 Subject: [PATCH] move from drone to gitea actions --- .drone.yml | 41 ---------------------------------- .gitea/workflows/deploy.yml | 44 +++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 41 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/deploy.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index e882ae6..0000000 --- a/.drone.yml +++ /dev/null @@ -1,41 +0,0 @@ -kind: pipeline -name: default - -clone: - disable: true - -steps: - - name: clone - image: alpine/git - commands: - - git lfs install - - git clone http://gitea:3000/${CI_REPO_NAME} . - - git checkout ${CI_COMMIT_SHA} - - name: build - image: git.ipng.ch/ipng/drone-hugo:release-0.161.1 - settings: - hugo_version: 0.161.1 - extended: true - - name: rsync - image: drillster/drone-rsync - settings: - user: drone - key: - from_secret: drone_sshkey - hosts: - - nginx0.chrma0.net.ipng.ch - - nginx0.chplo0.net.ipng.ch - - nginx0.chlzn0.net.ipng.ch - - nginx0.frggh0.net.ipng.ch - - nginx0.nlams0.net.ipng.ch - - nginx0.nlams1.net.ipng.ch - - nginx0.nlams2.net.ipng.ch - port: 22 - args: '-6u --delete-after' - source: public/ - target: /nginx/sites/ipng.ch/ - recursive: true - secrets: [ drone_sshkey ] - -image_pull_secrets: - - git_ipng_ch_docker diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..e1e64aa --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,44 @@ +name: Build and Deploy + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: debian-slim + container: + image: hugomods/hugo:debian-dart-sass-node-git-0.161.1 + steps: + - name: Install packages + env: + DEBIAN_FRONTEND: noninteractive + run: apt-get update -qq && apt-get install -qq -y git-lfs rsync > /dev/null + + - name: Checkout with LFS + uses: actions/checkout@v4 + with: + lfs: true + + - name: Build Hugo site + run: hugo --minify + + - name: Deploy via rsync + env: + SSH_KEY: ${{ secrets.drone_sshkey }} + run: | + mkdir -p ~/.ssh + echo "$SSH_KEY" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + for host in \ + nginx0.chrma0.net.ipng.ch \ + nginx0.chplo0.net.ipng.ch \ + nginx0.chlzn0.net.ipng.ch \ + nginx0.frggh0.net.ipng.ch \ + nginx0.nlams0.net.ipng.ch \ + nginx0.nlams1.net.ipng.ch \ + nginx0.nlams2.net.ipng.ch; do + cmd="rsync -6a --delete-after -e \"ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o LogLevel=ERROR\" public/ drone@${host}:/nginx/sites/ipng.ch/" + echo "${cmd}" + eval "${cmd}" + done