mirror of
https://github.com/KevinMidboe/k9e.no.git
synced 2025-10-29 09:40:13 +00:00
74 lines
1.2 KiB
YAML
74 lines
1.2 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Build
|
|
|
|
platform:
|
|
os: linux
|
|
arch: amd64
|
|
|
|
steps:
|
|
- name: Lint project
|
|
image: node:21-alpine3.17
|
|
commands:
|
|
- yarn
|
|
- yarn lint
|
|
|
|
- name: Build app
|
|
image: node:21-alpine3.17
|
|
commands:
|
|
- yarn
|
|
- yarn build
|
|
|
|
- name: Publish docker image
|
|
image: plugins/docker
|
|
settings:
|
|
registry: ghcr.io
|
|
repo: ghcr.io/kevinmidboe/k9e.no
|
|
dockerfile: Dockerfile
|
|
username:
|
|
from_secret: GITHUB_USERNAME
|
|
password:
|
|
from_secret: GITHUB_PASSWORD
|
|
tags: latest
|
|
when:
|
|
event:
|
|
include:
|
|
- push
|
|
exclude:
|
|
- pull_request
|
|
branch:
|
|
- main
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Deploy
|
|
|
|
platform:
|
|
os: linux
|
|
arch: amd64
|
|
|
|
steps:
|
|
- name: Deploy app to kubernetes
|
|
image: alpine/k8s:1.25.15
|
|
commands:
|
|
- mkdir -p /root/.kube
|
|
- echo $KUBE_CONFIG | base64 -di > /root/.kube/config
|
|
- kubectl --kubeconfig=/root/.kube/config get pods
|
|
environment:
|
|
KUBE_CONFIG:
|
|
from_secret: KUBE_CONFIG
|
|
when:
|
|
event:
|
|
include:
|
|
- push
|
|
exclude:
|
|
- pull_request
|
|
branch:
|
|
- main
|
|
- kube
|
|
|
|
depends_on:
|
|
- Build
|