test ci
Some checks failed
Build / build (push) Failing after 46s

This commit is contained in:
Twilight 2024-08-09 00:16:29 +08:00
parent 6dfabec9bc
commit 0aad05fa44
3 changed files with 47 additions and 28 deletions

View File

@ -1,9 +1,15 @@
name: Build
# on:
# push:
# paths:
# - manifest.yaml
on:
push:
paths:
- manifest.yaml
paths-ignore:
- 'manifests/**'
jobs:
build:
@ -37,3 +43,17 @@ jobs:
docker build . -f Dockerfile --tag leafdev.top/leaf/amber-web:${{ steps.commit.outputs.short }}
docker push leafdev.top/leaf/amber-web:${{ steps.commit.outputs.short }}
docker tag leafdev.top/leaf/amber-web:${{ steps.commit.outputs.short }} leafdev.top/leaf/amber-web:latest
- name: 'Patch Manifest'
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'manifests/deployment.yaml'
propertyPath: 'spec.template.spec.containers[0].image'
value: 'leafdev.top/leaf/amber-web:${{ steps.commit.outputs.short }}'
commitChange: true
- name: Push
run: |
git config user.name ${{ gitea.actor }}
git config user.email ${{ gitea.actor }}@users.noreply.leafdev.top
git add manifests/deployment.yaml
git commit -m "Update manifests"
git push

24
manifests/deployment.yaml Normal file
View File

@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: amber-web
namespace: amber
spec:
replicas: 1
selector:
matchLabels:
app: amber-web
template:
metadata:
labels:
app: amber-web
spec:
imagePullSecrets:
- name: leaf
containers:
- name: amber
image: registry.leafdev.top/leaf/amber-web:v0.0.3
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
name: http-80

View File

@ -1,28 +1,3 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: amber-web
namespace: amber
spec:
replicas: 1
selector:
matchLabels:
app: amber-web
template:
metadata:
labels:
app: amber-web
spec:
imagePullSecrets:
- name: leaf
containers:
- name: amber
image: registry.leafdev.top/leaf/amber-web:v0.0.3
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
name: http-80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata: