[ci] feat: migrated to gitea actions workflow
This commit is contained in:
parent
ba00a13874
commit
af40e11bb5
86
.drone.yml
86
.drone.yml
@ -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'
|
64
.gitea/workflows/build.yaml
Normal file
64
.gitea/workflows/build.yaml
Normal file
@ -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
|
Reference in New Issue
Block a user