Files
paperless-ngx-deployment/.gitea/workflows/deploy.yml
T
feedc0de 5b4956ff2b
Test and deploy / test (push) Successful in 13s
Test and deploy / deploy (push) Successful in 2m22s
Fix CI registry isolation and deployment prerequisites
2026-10-14 20:57:50 +02:00

36 lines
1.2 KiB
YAML

name: Test and deploy
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
container: node:22-alpine
steps:
- uses: actions/checkout@v4
- run: apk add --no-cache bash python3 py3-yaml && ./test.sh
deploy:
if: github.event_name == 'push'
needs: test
runs-on: ubuntu-latest
container: node:22-alpine
steps:
- uses: actions/checkout@v4
- run: apk add --no-cache bash python3 py3-yaml kubectl
- run: |
umask 077
if [ -z "$KUBE_CONFIG_BASE64" ]; then
echo 'Set the KUBE_CONFIG_BASE64 repository secret using ./create-ci-kubeconfig.sh' >&2
exit 1
fi
echo "$KUBE_CONFIG_BASE64" | base64 -d > kubeconfig
export KUBECONFIG="$PWD/kubeconfig"
cluster=$(kubectl config view --minify -o jsonpath='{.contexts[0].context.cluster}')
kubectl config set-cluster "$cluster" --server=https://host.containers.internal:6443 --tls-server-name=192.168.0.2
trap 'rm -f "$KUBECONFIG"' EXIT
./deploy.sh
rm -f kubeconfig
env:
KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64 }}