From 6dfabec9bce48b34d330182d68c3ba48b8a6dad4 Mon Sep 17 00:00:00 2001 From: Twilight Date: Fri, 9 Aug 2024 00:05:41 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..b706565 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + paths: + - manifest.yaml + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - id: commit + uses: prompt/actions-commit-hash@v3 + - name: Setup NodeJS + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Get dependencies + run: | + go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct + go mod download + - name: Build + run: | + npm install + npm run build + - name: 'Login to Container Registry' + uses: docker/login-action@v3 + with: + registry: leafdev.top + username: ${{ gitea.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + - name: 'Build Inventory Image' + 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 From 0aad05fa445508cd1696c85fd4433b94ec9cfb81 Mon Sep 17 00:00:00 2001 From: Twilight Date: Fri, 9 Aug 2024 00:16:29 +0800 Subject: [PATCH 2/9] test ci --- .gitea/workflows/build.yaml | 26 +++++++++++++++++++++--- manifests/deployment.yaml | 24 ++++++++++++++++++++++ manifest.yaml => manifests/manifest.yaml | 25 ----------------------- 3 files changed, 47 insertions(+), 28 deletions(-) create mode 100644 manifests/deployment.yaml rename manifest.yaml => manifests/manifest.yaml (52%) 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: From 307aeb920bcba01acd0d2b4ce6958b8df20ced38 Mon Sep 17 00:00:00 2001 From: Twilight Date: Fri, 9 Aug 2024 00:17:55 +0800 Subject: [PATCH 3/9] test ci --- .gitea/workflows/build.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 7413751..abbe2ee 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -24,10 +24,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: 18 - - name: Get dependencies - run: | - go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct - go mod download - name: Build run: | npm install From f2aa1fd3c64bfe5ac83045c153d0b4753caa5b7b Mon Sep 17 00:00:00 2001 From: Twilight Date: Fri, 9 Aug 2024 00:20:07 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1dfae01..462eb1e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ }, "devDependencies": { "@babel/types": "^7.24.7", - "@rollup/rollup-win32-x64-msvc": "^4.20.0", "@types/node": "^20.14.14", "@vitejs/plugin-vue": "^5.0.5", "@vue/eslint-config-typescript": "^13.0.0", @@ -50,5 +49,8 @@ "vite-plugin-vuetify": "^2.0.3", "vue-router": "^4.4.0", "vue-tsc": "^2.0.26" + }, + "optionalDependencies": { + "@rollup/rollup-win32-x64-msvc": "^4.20.0" } } From 31afc4d520494a89ba514e81d3d16279e816c12d Mon Sep 17 00:00:00 2001 From: Twilight Date: Fri, 9 Aug 2024 00:23:05 +0800 Subject: [PATCH 5/9] test ci --- .gitea/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index abbe2ee..dfcddb0 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -52,4 +52,4 @@ jobs: 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 + git push https://${{ secrets.GITEA_TOKEN }}@leafdev.top/${{ gitea.repository }}.git \ No newline at end of file From 90c0999b4f2d0dc24f4e721ab2de7c7eee0a57c7 Mon Sep 17 00:00:00 2001 From: Twilight Date: Fri, 9 Aug 2024 00:24:52 +0800 Subject: [PATCH 6/9] test ci --- .gitea/workflows/build.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index dfcddb0..48b228e 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -45,11 +45,12 @@ jobs: valueFile: 'manifests/deployment.yaml' propertyPath: 'spec.template.spec.containers[0].image' value: 'leafdev.top/leaf/amber-web:${{ steps.commit.outputs.short }}' - commitChange: true + commitChange: false - 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 https://${{ secrets.GITEA_TOKEN }}@leafdev.top/${{ gitea.repository }}.git \ No newline at end of file + # git push https://${{ secrets.GITEA_TOKEN }}@leafdev.top/${{ gitea.repository }}.git + git push \ No newline at end of file From e7291f03d02eb6103e10ce35087bce914e5835b4 Mon Sep 17 00:00:00 2001 From: ivampiresp Date: Thu, 8 Aug 2024 16:31:22 +0000 Subject: [PATCH 7/9] Update manifests --- manifests/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/deployment.yaml b/manifests/deployment.yaml index d220d56..b7998e2 100644 --- a/manifests/deployment.yaml +++ b/manifests/deployment.yaml @@ -17,8 +17,8 @@ spec: - name: leaf containers: - name: amber - image: registry.leafdev.top/leaf/amber-web:v0.0.3 + image: leafdev.top/leaf/amber-web:90c0999 imagePullPolicy: IfNotPresent ports: - containerPort: 80 - name: http-80 \ No newline at end of file + name: http-80 From 3695ce820f776b89511397fe443bba122910c7b7 Mon Sep 17 00:00:00 2001 From: Twilight Date: Fri, 9 Aug 2024 00:50:08 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E7=AE=80=E5=8D=95=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=B8=8B=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/pages/index.vue b/src/pages/index.vue index 18840e3..9527e63 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -1,6 +1,20 @@ - + From f24238cfc895a74cb35e9129fe73926b4d0ff948 Mon Sep 17 00:00:00 2001 From: ivampiresp Date: Thu, 8 Aug 2024 16:49:31 +0000 Subject: [PATCH 9/9] Update manifests --- manifests/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/deployment.yaml b/manifests/deployment.yaml index b7998e2..82ef9f4 100644 --- a/manifests/deployment.yaml +++ b/manifests/deployment.yaml @@ -17,7 +17,7 @@ spec: - name: leaf containers: - name: amber - image: leafdev.top/leaf/amber-web:90c0999 + image: leafdev.top/leaf/amber-web:3695ce8 imagePullPolicy: IfNotPresent ports: - containerPort: 80