start.simoncor.net/.gitea/workflows/build.yaml

69 lines
1.7 KiB
YAML
Raw Normal View History

---
# generic
name: 'Build and Publish'
on:
schedule:
- '30 8 * * sun'
push:
branches:
2024-07-25 09:32:54 +02:00
- 'main'
# jobs
jobs:
# build container
2024-07-04 16:09:05 +02:00
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
2024-09-06 13:54:21 +02:00
tags: 'cr.simoncor.net/siempie/start-simoncor-net:latest,cr.simoncor.net/siempie/start-simoncor-net:${{ gitea.sha }}'
2024-09-06 13:56:46 +02:00
# kubernetes deployment
2024-07-04 16:09:05 +02:00
Deployment:
runs-on: 'ubuntu-latest'
2024-09-06 13:55:28 +02:00
needs: 'Build'
steps:
# name: Build
2024-09-06 13:56:46 +02:00
- name: 'Kubernetes deployment'
uses: 'appleboy/ssh-action@v1.0.3'
with:
# bastion
2024-09-06 13:56:46 +02:00
proxy_host: 'wireguard.do.siempie.com'
proxy_port: '22'
proxy_username: ${{ secrets.USERNAME }}
proxy_key: ${{ secrets.SSHKEY }}
2024-09-06 13:56:46 +02:00
# kubernetes management
host: 'mgmt01.infra.vpn.mirahsimon.us'
port: '22'
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSHKEY }}
# command
script: |
2024-09-06 13:54:21 +02:00
sudo -u simon kubectl apply -f /home/simon/Documents/kaas-start-simoncor-net/manifests
sudo -u simon kubectl rollout restart --namespace=start-simoncor-net deployment start-simoncor-net