ssh
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 18s

This commit is contained in:
编码猿
2025-10-05 02:40:59 +08:00
parent da7c078377
commit e05fc3d400
4 changed files with 44 additions and 49 deletions

View File

@@ -1,43 +1,43 @@
name: 构建项目
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
# name: 构建项目
# run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
# 2. 触发条件 (on)
on: [push]
# # 2. 触发条件 (on)
# on: [push]
# 3. 作业定义 (jobs)
jobs:
构建:
# 4. 运行器选择 (runs-on)
runs-on: ubuntu-latest
# # 3. 作业定义 (jobs)
# jobs:
# 构建:
# # 4. 运行器选择 (runs-on)
# runs-on: ubuntu-latest
# 5. 步骤序列 (steps)
steps:
# 步骤 1: 检出代码
- name: 检出代码
uses: https://gitea.com/actions/checkout@v4
# # 5. 步骤序列 (steps)
# steps:
# # 步骤 1: 检出代码
# - name: 检出代码
# uses: https://gitea.com/actions/checkout@v4
- name: 显示目录
run: ls -la
# - name: 显示目录
# run: ls -la
# 步骤 2: 设置 Node.js 环境
- name: 设置 Node.js 环境
uses: https://gitea.com/actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
# # 步骤 2: 设置 Node.js 环境
# - name: 设置 Node.js 环境
# uses: https://gitea.com/actions/setup-node@v4
# with:
# node-version: 22
# cache: 'npm'
# 步骤 3: 安装依赖
- name: 安装依赖
run: npm ci
# # 步骤 3: 安装依赖
# - name: 安装依赖
# run: npm ci
# 步骤 4: 执行打包命令
- name: 执行Build构建
run: npm run build
# # 步骤 4: 执行打包命令
# - name: 执行Build构建
# run: npm run build
# 步骤 5: 上传打包产物
- name: 上传构建产物
uses: https://gitea.com/actions/upload-artifact@v3
with:
name: dist
path: dist/
# # 步骤 5: 上传打包产物
# - name: 上传构建产物
# uses: https://gitea.com/actions/upload-artifact@v3
# with:
# name: dist
# path: dist/

View File

@@ -16,6 +16,15 @@ jobs:
# 步骤序列
steps:
- name: 执行远程 SSH 命令(密码认证)
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: whoami
# 步骤1输出事件信息
- run: echo "🎉 该作业由 ${{ gitea.event_name }} 事件自动触发。"

View File

@@ -1,14 +0,0 @@
{
"WARNING": "This file is automatically generated by act-runner. Do not edit it manually unless you know what you are doing. Removing this file will cause act runner to re-register as a new runner.",
"id": 136,
"uuid": "7369696a-3bf3-433c-bc2b-feed3a5e2b37",
"name": "c94ca9934df2",
"token": "6024bd7d31b62263604bfda44f0b110f454431dd",
"address": "https://git.bmycode.help",
"labels": [
"ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest",
"ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04",
"ubuntu-20.04:docker://docker.gitea.com/runner-images:ubuntu-20.04"
],
"ephemeral": false
}

View File

@@ -36,7 +36,7 @@ services:
GITEA_RUNNER_REGISTRATION_TOKEN: WFiO5JDwz7CHnk7fMGJYMcSITU81CLXuI7Ofg10e
volumes:
- ./config.yaml:/config.yaml
- ./data:/data
- runner-data:/data
- /var/run/docker.sock:/var/run/docker.sock
volumes: