Compare commits

...

10 Commits

Author SHA1 Message Date
06d7e193ea ssh-2
Some checks failed
SSH 连接测试 / ssh-test (push) Failing after 31s
2025-04-05 13:51:19 +08:00
bb1998ea21 ssh-2 2025-04-05 13:46:33 +08:00
873c000060 123 2025-04-05 13:40:38 +08:00
774123eefc ci-10-2 2025-04-05 13:01:15 +08:00
9a959b4cae ci-10 2025-04-05 12:58:38 +08:00
ea770f4ae8 ci(gitea): update Docker build workflow
- Update registry to use GHCR (GitHub Container Registry)
- Simplify environment variables and remove unused ones
- Refactor branch handling and tag generation
- Remove Docker metadata action and simplify build process
- Add debug information output
- Update comments and structure for better readability
2025-04-05 12:56:54 +08:00
483296f906 ci-9 2025-04-05 12:26:57 +08:00
30f452b44d ci: fix typo in echo command and update login step name
- Fix typo
2025-04-05 12:24:24 +08:00
e1c08e261a ci-8-2 2025-04-05 12:23:54 +08:00
2843946171 ci-8 2025-04-05 12:22:31 +08:00
2 changed files with 22 additions and 53 deletions

View File

@ -1,53 +0,0 @@
name: Build and Run Docker Image
on:
push:
branches:
- "**" # 匹配所有分支
paths-ignore: # 忽略一些不必要的文件
- ".gitignore"
- "README.md"
- ".vscode/**"
pull_request:
branches: ["main"]
env:
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-and-run:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 获取分支名称
id: branch_name
run: |
# 从 GITHUB_REF 提取分支名
branch=${GITHUB_REF#refs/heads/}
echo "branch=$branch" >> $GITHUB_OUTPUT
# 如果是 main 分支,使用 prod 标签,否则使用 dev-分支名
if [ "$branch" = "main" ]; then
echo "env_suffix=prod" >> $GITHUB_OUTPUT
else
echo "env_suffix=dev-${branch}" >> $GITHUB_OUTPUT
fi
- name: 设置 Docker 镜像标签
id: docker_tags
run: |
echo "tag=${{ env.IMAGE_NAME }}:${{ steps.branch_name.outputs.env_suffix }}" >> $GITHUB_OUTPUT
- name: 构建 Docker 镜像
run: |
docker build -t ${{ steps.docker_tags.outputs.tag }} .
- name: 运行 Docker 容器
run: |
docker run -d --name catface_${{ steps.branch_name.outputs.env_suffix }} \
-p 20201:20201 \
${{ steps.docker_tags.outputs.tag }}

View File

@ -0,0 +1,22 @@
name: SSH 连接测试
on:
workflow_dispatch: # 手动触发
push:
branches:
- main # 仅main分支触发
jobs:
ssh-test:
runs-on: ubuntu-latest
steps:
- name: SSH 连接测试
uses: appleboy/ssh-action@master
with:
host: 120.27.198.238
username: root
password: Havocantelope420#
port: '22'
script: |
echo "Running command on remote server"
ls -lha