diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index b706565..7413751 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,9 +1,15 @@ name: Build +# on: +# push: +# paths: +# - manifest.yaml + + on: push: - paths: - - manifest.yaml + paths-ignore: + - 'manifests/**' jobs: build: @@ -36,4 +42,18 @@ jobs: run: | 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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/manifests/deployment.yaml b/manifests/deployment.yaml new file mode 100644 index 0000000..d220d56 --- /dev/null +++ b/manifests/deployment.yaml @@ -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 \ No newline at end of file diff --git a/manifest.yaml b/manifests/manifest.yaml similarity index 52% rename from manifest.yaml rename to manifests/manifest.yaml index d71d515..bf55236 100644 --- a/manifest.yaml +++ b/manifests/manifest.yaml @@ -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: