From af40e11bb57e33ed53708c6381503a54b41eb119 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Tue, 2 Jul 2024 16:43:21 +0200 Subject: [PATCH] [ci] feat: migrated to gitea actions workflow --- .drone.yml | 86 ------------------------------------- .gitea/workflows/build.yaml | 64 +++++++++++++++++++++++++++ README.md | 1 - 3 files changed, 64 insertions(+), 87 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/build.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index b5f5165..0000000 --- a/.drone.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -kind: 'pipeline' -name: 'build' -type: 'kubernetes' - -steps: - -# build and publish -- image: 'docker.io/plugins/docker' - name: 'publish' - pull: 'always' - when: - branch: - - 'main' - event: - - 'push' - - settings: - - # registery and repos - registry: 'cr.simoncor.net' - repo: 'cr.simoncor.net/siempie/roundcube' - mtu: '1440' - - # build stuff - dockerfile: 'Dockerfile.linux.amd64' - daemon_off: 'false' - - # authentication - username: - from_secret: 'docker_username' - password: - from_secret: 'docker_password' - - # tags - tags: - - 'v1' - - 'latest' - - -# kubernetes deployment ---- -kind: 'pipeline' -name: 'deployment' -type: 'kubernetes' - -depends_on: - - 'build' - -# disable clone -clone: - disable: true - -# deployment step -steps: - - # kubernetes deployment - - name: 'kubernetes deployment' - image: 'docker.io/appleboy/drone-ssh:1' - when: - branch: - - 'master' - event: - - 'push' - - settings: - - # bastion - proxy_host: 'siempie.com' - proxy_port: '22' - proxy_user: - from_secret: 'drone_user' - proxy_key: - from_secret: 'drone_ssh_key' - - # k9s - host: 'k9s.siempie.internal' - port: '22' - user: - from_secret: 'drone_user' - key: - from_secret: 'drone_ssh_key' - script: - - # kubernetes deployment - - 'kubectl -n roundcube rollout restart statefulsets roundcube-app' diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..e5d0819 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,64 @@ +--- + +# generic +name: 'Build and Publish' +on: + push: + branches: + - 'master' + +# build job +jobs: + build: + runs-on: 'ubuntu-latest' + steps: + + # checkout code + - name: 'Clone repo' + uses: 'actions/checkout@v2' + + # login to cr.simoncor.net + - name: 'Login to cr.simoncor.net' + uses: 'docker/login-action@v2' + with: + registry: 'cr.simoncor.net' + username: ${{ vars.REGISTER_USERNAME }} + password: ${{ vars.REGISTER_PASSWORD }} + + # build and publish container + - name: 'Build and Publish' + uses: 'docker/build-push-action@v3' + with: + context: '.' + file: 'Dockerfile.linux.amd64' + push: true + tags: | + cr.simoncor.net/siempie/roundcube:latest + cr.simoncor.net/siempie/roundcube:v1 + + + # ansible deployment + deployment: + runs-on: 'ubuntu-latest' + steps: + + # name: Build + - name: 'Ansible deployment' + uses: 'appleboy/ssh-action@v1.0.3' + with: + + # bastion + proxy_host: 'siempie.com' + proxy_port: '22' + proxy_username: ${{ secrets.USERNAME }} + proxy_key: ${{ secrets.SSHKEY }} + + # ansible management + host: 'ansible.siempie.internal' + port: '22' + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSHKEY }} + + # command + script: | + sudo /usr/local/bin/ansible-playbook /etc/ansible/playbooks/production/mail.yaml diff --git a/README.md b/README.md index 0abe695..96ab25f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![Build Status](https://ci.simoncor.net/api/badges/siempie/roundcube/status.svg)](https://ci.simoncor.net/siempie/roundcube) Simple Roundcube container with some plugins pre-installed. | package | version | link |