Compare commits

...

52 Commits

Author SHA1 Message Date
Gitea Action
bea436058d chore: update image to 000f34a059 [skip ci] 2026-01-25 13:42:45 +00:00
Zpekii
000f34a059 chore: update deploy.yaml
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m47s
2026-01-25 21:40:55 +08:00
Zpekii
93837e0248 chore: udpate deploy.yaml
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m38s
2026-01-25 21:34:49 +08:00
root
e90fa00227 Merge branch 'main' of https://git.0orz.top/Zpekii/go-example
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m40s
2026-01-25 21:27:52 +08:00
root
bd18f32670 chore: update kustomizations 2026-01-25 21:26:44 +08:00
Flux
6e2e0f0ed0 Add Flux sync manifests
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2026-01-25 21:20:17 +08:00
Flux
42becfe8b0 Add Flux v2.7.5 component manifests
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2026-01-25 21:20:12 +08:00
Zpekii
b385dfb0ec chore: rm flux [skip ci] 2026-01-25 21:17:05 +08:00
Zpekii
925e346df3 chore: delete flux kustomizations [skip ci] 2026-01-25 21:16:43 +08:00
Flux
3b1c6f4ee9 Add Flux sync manifests
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 33m43s
2026-01-25 20:38:45 +08:00
Flux
e4364224bd Add Flux v2.7.5 component manifests
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2026-01-25 20:38:40 +08:00
Gitea Action
1db170150f chore: update image to 8b5d44399e [skip ci] 2026-01-25 12:25:50 +00:00
Zpekii
8b5d44399e Merge branch 'main' of https://git.0orz.top/Zpekii/go-example
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m34s
2026-01-25 20:24:15 +08:00
Zpekii
062b40cf13 ci: update kustomization 2026-01-25 20:24:12 +08:00
Gitea Action
f130badb33 chore: update image to 4c748b20e3 [skip ci] 2026-01-25 10:04:51 +00:00
Zpekii
4c748b20e3 Merge branch 'main' of https://git.0orz.top/Zpekii/go-example
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m47s
2026-01-25 18:03:01 +08:00
Zpekii
8714af1ed6 chore: update kustomization 2026-01-25 18:02:59 +08:00
Gitea Action
ac450cfa29 chore: update image to 76a838ef4f [skip ci] 2026-01-25 09:58:43 +00:00
Zpekii
76a838ef4f chore: comment golangci-lint
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m43s
2026-01-25 17:56:57 +08:00
Zpekii
876b4ed497 Merge branch 'main' of https://git.0orz.top/Zpekii/go-example
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 13m51s
2026-01-25 17:38:05 +08:00
Zpekii
4e1822bafa chore: update flux kustomization 2026-01-25 17:37:59 +08:00
Gitea Action
212099a265 chore: update image to 8edf753f47 [skip ci] 2026-01-25 09:34:15 +00:00
Zpekii
8edf753f47 Merge branch 'main' of https://git.0orz.top/Zpekii/go-example
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7m15s
2026-01-25 17:26:58 +08:00
Zpekii
50aad7aaed chore: update kustomization 2026-01-25 17:26:56 +08:00
Gitea Action
54346e072d chore: update image to 4154c807b1 [skip ci] 2026-01-25 09:19:14 +00:00
root
4154c807b1 chore: update flux
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m32s
2026-01-25 17:16:32 +08:00
root
0b9e58896f chore: add go-example kustomization [skip ci] 2026-01-25 17:12:44 +08:00
Gitea Action
f61941608b chore: update image to 2ea535146f [skip ci] 2026-01-25 08:43:05 +00:00
Zpekii
2ea535146f Merge branch 'main' of https://git.0orz.top/Zpekii/go-example
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m51s
2026-01-25 16:40:13 +08:00
Zpekii
9694ae0289 chore: edit request resources 2026-01-25 16:40:11 +08:00
Gitea Action
6f4be9695f chore: update image to 05e25ab63e [skip ci] 2026-01-25 08:24:11 +00:00
Zpekii
05e25ab63e Merge branch 'main' of https://git.0orz.top/Zpekii/go-example
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m31s
2026-01-25 16:21:39 +08:00
Zpekii
78c839f3a7 ci: add kustomization 2026-01-25 16:21:38 +08:00
Gitea Action
02d16f9612 chore: update image to d21cd672a6 [skip ci] 2026-01-25 08:08:54 +00:00
Zpekii
d21cd672a6 ci: update harbor
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m55s
2026-01-25 16:06:56 +08:00
Zpekii
4c3670a43c ci: update harbor
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m44s
2026-01-25 15:41:46 +08:00
Zpekii
4a0b8404f1 ci: add goproxy
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m53s
2026-01-25 14:13:52 +08:00
41b2458f0d ci: update image
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 4m50s
2026-01-24 21:12:35 +08:00
ec019c24ab ci: update
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 50s
2026-01-24 21:03:36 +08:00
e901a905c6 ci: add node volume
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 3s
2026-01-24 20:56:46 +08:00
4d593c7e74 ci: add node
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 3s
2026-01-24 20:55:15 +08:00
4b757dc60c ci: update uses
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6s
2026-01-24 20:47:56 +08:00
69cbfd9c2e ci: update
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
2026-01-24 20:35:37 +08:00
dfcea9ec22 ci: change uses
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
2026-01-24 20:32:11 +08:00
a5d926df13 ci: update uses tag
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
2026-01-24 20:11:43 +08:00
68a8f4e71b ci: edit uses
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 12s
2026-01-24 20:06:31 +08:00
dfb786c0a7 ci: update uses
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 11s
2026-01-24 19:58:50 +08:00
64d90a5a1c ci: update uses
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
2026-01-24 19:43:44 +08:00
ae1cfb214a ci: update uses
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 3s
2026-01-24 19:08:30 +08:00
b7a0a9399e chore: chage docker path
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 17m15s
2026-01-24 15:43:16 +08:00
1dbd408bb0 Merge branch 'main' of https://git.0orz.top/Zpekii/go-example
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m32s
2026-01-24 15:07:19 +08:00
dcd2545360 chore: update ci 2026-01-24 15:07:02 +08:00
8 changed files with 74 additions and 25 deletions

View File

@@ -4,20 +4,22 @@ on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: gitea-runner
runs-on: nodejs
container:
image: alpine:gitea-runner
image: node:gitea-runner
volumes:
- data:/var/data
- deploy:/var/deploy
- /usr/bin/docker:/usr/bin/docker
- /var/data/zApps:/var/data/zApps
- /var/data/zUser/apps:/var/data/zUser/apps
- /var/data/zApps/bin/docker/docker:/usr/bin/docker
steps:
- run: echo "PATH=/var/data/zApps/go/bin:$PATH" >> $GITHUB_ENV
- run: echo "GOPATH=/var/data/zUser/apps/go" >> $GITHUB_ENV
- run: echo "GOPROXY=https://goproxy.cn,direct" >> $GITHUB_ENV
- run: echo "PATH=/var/data/zApps/bin:/var/data/zUser/apps/node/bin:/var/data/zUser/apps/go/bin:/var/data/zApps/go/bin:$PATH" >> $GITHUB_ENV
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v6
uses: https://git.0orz.top/actions/checkout@v6.0.2
with:
fetch-depth: 1
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
@@ -28,8 +30,10 @@ jobs:
- name: Check go version
run: |
go version
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
# - name: Run golangci-lint
# run: |
# cd ${{ gitea.workspace }}
# golangci-lint run ./...
- name: Tests
run: |
cd ${{ gitea.workspace }}
@@ -44,23 +48,23 @@ jobs:
docker --version
- name: Login to Harbor
run: |
echo "${{ secrets.HARBOR_PASSWORD }}" | docker login localhost:8180 -u "${{ secrets.HARBOR_USERNAME }}" --password-stdin
echo "${{ secrets.HARBOR_PASSWORD }}" | docker login harbor.0orz.top -u "${{ secrets.HARBOR_USERNAME }}" --password-stdin
- name: Build Docker image
run: |
cd ${{ gitea.workspace }}
docker build -t localhost:8180/go-example/go-example:${{ gitea.sha }} .
docker build -t harbor.0orz.top/go-example/go-example:${{ gitea.sha }} .
- name: Push Docker image to local registry
run: |
docker push localhost:8180/go-example/go-example:${{ gitea.sha }}
- name: Update manifest and Push to Git
docker push harbor.0orz.top/go-example/go-example:${{ gitea.sha }}
- name: Update manifest and Push to Git
run: |
# 使用 kustomize 或 sed 修改镜像版本
sed -i "s|image: .*:.*|image: localhost:8180/go-example/go-example:${{ gitea.sha }}|g" deployment.yaml
sed -i "s|image: .*:.*|image: harbor.0orz.top/go-example/go-example:${{ gitea.sha }}|g" kustomize/deployment.yaml
# 配置 Git 并提交回仓库
git config --global user.name "Gitea Action"
git config --global user.email "action@gitea.io"
git add deployment.yaml
git add kustomize/deployment.yaml
git commit -m "chore: update image to ${{ gitea.sha }} [skip ci]"
git push origin main
- run: echo "🍏 This job's status is ${{ job.status }}."
- run: echo "🍏 This job's status is ${{ job.status }}."

12
clusters/app/flux-deploy.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
USER_NAME=Zpekii
BRANCH=main
URL=https://git.0orz.top/Zpekii/go-example.git
flux bootstrap git \
--url=$URL \
--branch=$BRANCH \
--username=$USER_NAME \
--token-auth=true \
--path=./clusters/app

View File

@@ -20,7 +20,7 @@ metadata:
namespace: flux-system
spec:
interval: 10m0s
path: ./
path: ./clusters/app
prune: true
sourceRef:
kind: GitRepository

View File

@@ -0,0 +1,17 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: go-example
namespace: flux-system
spec:
interval: 30m0s
path: ./kustomize
prune: true
retryInterval: 2m0s
sourceRef:
kind: GitRepository
name: go-example
targetNamespace: helloapp
timeout: 3m0s
wait: true

View File

@@ -0,0 +1,11 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: go-example
namespace: flux-system
spec:
interval: 1m0s
ref:
branch: main
url: https://git.0orz.top/Zpekii/go-example

View File

@@ -1,4 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
name: helloapp
---
apiVersion: v1
kind: Service
metadata:
name: go-example
@@ -28,15 +33,15 @@ spec:
spec:
containers:
- name: go-example
image: localhost:8180/go-example/go-example:0b2c48ee261873d5a5b2146f424e2a68ce33d4da
image: harbor.0orz.top/go-example/go-example:000f34a0591306e686e8cf06bf131449eb30b028
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "128Mi"
cpu: "500m"
memory: "5Mi"
cpu: "10m"
limits:
memory: "128Mi"
cpu: "500m"
memory: "50Mi"
cpu: "100m"
ports:
- containerPort: 8800
volumeMounts:
@@ -52,7 +57,7 @@ spec:
name: go-example-config
- name: helloapp-test-key
secret:
secretName: helloapp-test-key
secretName: helloapp-test-key # 需要事先创建该 Secret
---
apiVersion: v1
kind: ConfigMap
@@ -64,4 +69,4 @@ data:
server:
port: 8800
certs:
testKeyPath: /certs/test.key
testKeyPath: /certs/test.key