Reviewed-on: #3 Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
55 lines
1.9 KiB
YAML
55 lines
1.9 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "k8s/**"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- uses: https://gitea.t000-n.de/t.behrendt/k_deploy_workflows/.gitea/actions/extract-namespace-from-repo-name@c373c34c836716e663e2d6379e686997bfd7746c # 0.0.6
|
|
id: namespace
|
|
with:
|
|
repo: ${{ github.repository }}
|
|
- uses: azure/setup-kubectl@15650b3ad78fff148532a140b8a4c821796b2d7b # v5.0.0
|
|
- uses: azure/k8s-set-context@ae59a723ba9abe7a9655538854a025448dbab4aa # v4.0.2
|
|
with:
|
|
method: kubeconfig
|
|
kubeconfig: ${{ secrets.KUBECONFIG }}
|
|
- name: Set restic backup secret
|
|
uses: azure/k8s-create-secret@6e0ba8047235646753f2a3a3b359b4d0006ff218 # v5.0.1
|
|
with:
|
|
namespace: ${{ steps.namespace.outputs.namespace }}
|
|
secret-name: backup-secret
|
|
secret-type: generic
|
|
data: |
|
|
{
|
|
"restic_password": "${{ secrets.RESTIC_PASSWORD }}",
|
|
"restic_rest_username": "${{ secrets.RESTIC_REST_USERNAME }}",
|
|
"restic_rest_password": "${{ secrets.RESTIC_REST_PASSWORD }}",
|
|
"gotify_token": "${{ secrets.GOTIFY_TOKEN }}"
|
|
}
|
|
- name: Create paperless secret
|
|
uses: azure/k8s-create-secret@6e0ba8047235646753f2a3a3b359b4d0006ff218 # v5.0.1
|
|
with:
|
|
namespace: ${{ steps.namespace.outputs.namespace }}
|
|
secret-name: paperless-secret
|
|
secret-type: generic
|
|
data: |
|
|
{
|
|
"PAPERLESS_SECRET_KEY": "${{ secrets.PAPERLESS_SECRET_KEY }}"
|
|
}
|
|
- name: Deploy
|
|
uses: azure/k8s-deploy@c8cfec839dc09896b3b8cc40cd13d04792680771 # v5.1.0
|
|
with:
|
|
action: deploy
|
|
manifests: "k8s/"
|
|
strategy: basic
|
|
namespace: ${{ steps.namespace.outputs.namespace }}
|