10 Commits
Author SHA1 Message Date
ZSCGR 02e0616155 更新 .github/workflows/docker.yml
Publish Docker image to Gitea / Build and push to Gitea Registry (Internal) (push) Successful in 4m38s
Release / release (push) Failing after 12s
2025-12-07 19:02:53 +08:00
ZSCGR 06a16c2e03 更新 .github/workflows/docker.yml 2025-12-07 18:46:07 +08:00
ZSCGR 55582bb3f3 更新 .github/workflows/docker.yml 2025-12-07 18:28:21 +08:00
ZSCGR a7e5540122 更新 .github/workflows/docker.yml 2025-12-07 18:05:14 +08:00
ZSCGR 7bd07463a3 更新 .github/workflows/docker.yml 2025-12-07 16:35:26 +08:00
ZSCGR 5608f3e1f2 更新 .github/workflows/release.yml 2025-12-07 16:34:53 +08:00
ZSCGR c5853938ff 更新 .github/workflows/release.yml 2025-12-07 16:32:10 +08:00
ZSCGR ee00b5db5d 更新 .github/workflows/docker.yml 2025-12-07 16:31:02 +08:00
ZSCGR b660dc4613 更新 .github/workflows/release.yml
Publish Docker image to Gitea / Build and push to Gitea Registry (push) Failing after 2m59s
Release / release (push) Failing after 1m4s
2025-12-07 15:59:52 +08:00
ZSCGR 8a6aacc70d 更新 .github/workflows/docker.yml 2025-12-07 15:55:35 +08:00
2 changed files with 38 additions and 12 deletions
+19 -8
View File
@@ -1,4 +1,4 @@
name: Publish Docker image
name: Publish Docker image to Gitea
on:
push:
@@ -8,11 +8,12 @@ on:
jobs:
build-docker:
name: Push Docker image to multiple registries
name: Build and push to Gitea Registry (Internal)
runs-on: ubuntu-latest
permissions:
packages: write
packages: write # 必须:允许写入软件包
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
@@ -22,19 +23,29 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# 👇 告诉 Buildx 这个地址允许 HTTP (insecure)
driver-opts: network=1panel-network
config-inline: |
[registry."172.18.0.21:3000"]
http = true
insecure = true
- name: Log in to the Container registry
- name: Log in to Gitea Registry (Internal)
uses: docker/login-action@v3
with:
registry: ghcr.io
# ✅ 修改点1: 使用内网地址,避开 Cloudflare 和 WAF
registry: 172.18.0.21:3000
username: ${{ github.actor }}
password: ${{ secrets.GGITHUB_TOKEN }}
password: ${{ secrets.GGITEA_PAT }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
# ✅ 修改点2: 镜像名必须以 gitea:3000 开头,才能推送到内网注册中心
# Gitea 会自动处理映射,你在外网依然可以用 git.chgr.cc 拉取
images: 172.18.0.21:3000/${{ github.repository }}
- name: Build and push
uses: docker/build-push-action@v5
@@ -46,4 +57,4 @@ jobs:
linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
+19 -4
View File
@@ -2,7 +2,6 @@ name: Release
on:
push:
branch: main
tags:
- 'v*'
@@ -14,12 +13,28 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0 # 必须抓取完整历史才能生成日志
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npx changelogithub
# 步骤 1: 本地生成 Changelog (不依赖 GitHub API)
- name: Generate Changelog
run: |
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s
# 说明: 这会根据你的 commit 记录生成 CHANGELOG.md 文件
# 步骤 2: 发布 Release 到 Gitea
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md # 把生成的内容作为 Release 的描述
files: | # 如果你有构建产物想上传,写在这里
# dist/app.js
# build/*.zip
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GGITEA_PAT }}
# 关键: 如果 softprops 无法自动识别 Gitea,有时需要指定 URL,
# 但通常 Gitea Runner 会自动注入 GITHUB_API_URL 环境变量,
# 所以大多数情况下直接用即可。