Files
NGRX-Playground/.drone.yml
T
Dennis Hundertmark a779a16acb
continuous-integration/drone/pr Build is passing
ci: use netrc for manifest repo push
2026-03-09 12:40:01 +01:00

67 lines
1.6 KiB
YAML

kind: pipeline
type: kubernetes
name: pr-check
trigger:
event:
- pull_request
steps:
- name: build-angular
image: node:22-alpine
commands:
- npm ci
- npm run build
---
kind: pipeline
type: kubernetes
name: deploy
trigger:
branch:
- main
event:
- push
steps:
- name: build-angular
image: node:22-alpine
commands:
- npm ci
- npm run build
- name: build-and-push
image: plugins/docker
settings:
registry: gitea.mnky-code.de
repo: gitea.mnky-code.de/mnky/ngrx-playground
tags:
- ${DRONE_COMMIT_SHA}
username:
from_secret: gitea_username
password:
from_secret: gitea_password
- name: update-manifests
image: alpine:3.20
environment:
GITEA_USERNAME:
from_secret: gitea_git_username
GITEA_TOKEN:
from_secret: gitea_git_token
commands:
- apk add --no-cache git sed
- test -n "$GITEA_USERNAME"
- test -n "$GITEA_TOKEN"
- 'printf "machine gitea.mnky-code.de\nlogin %s\npassword %s\n" "$GITEA_USERNAME" "$GITEA_TOKEN" > ~/.netrc'
- chmod 600 ~/.netrc
- git clone https://gitea.mnky-code.de/mnky/k8s-manifests.git
- cd k8s-manifests
- 'sed -i "s|image: gitea.mnky-code.de/mnky/ngrx-playground:.*|image: gitea.mnky-code.de/mnky/ngrx-playground:${DRONE_COMMIT_SHA}|" ngrx-playground/deployment.yaml'
- git config user.name "drone"
- git config user.email "drone@mnky-code.de"
- git add ngrx-playground/deployment.yaml
- 'git commit -m "Deploy ngrx-playground ${DRONE_COMMIT_SHA}" || exit 0'
- git push origin HEAD:main