git - 如何为 GIthub 操作 CICD 使用旧的服务器存储库路径(自托管)
问题描述
我有一个生产服务器,我已经有一个项目存储库。现在我已经为 CICD 设置了 github 操作。我已经给出了我的工作区路径,但它正在创建 2 个与我的仓库名称相同的子目录。Github 操作没有使用我的旧存储库,它正在再次克隆存储库。所以在服务器文件结构中我有 2 个相同的项目。现在我想在我的服务器目录中使用单个存储库。我的 yaml 代码如下所示 -
name: Node.js CI
on:
push:
branches: [ deploy ]
pull_request:
branches: [ deploy ]
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i
- run: npm run build:uat
env:
CI: false
- run: rm -r /root/apps/frontend/build
- run: mv /root/apps/frontend/frontend/build /root/apps/frontend/
解决方案
推荐阅读
- mysql - MySQL Workbench - 如何在同一服务器上克隆具有不同名称的数据库?
- ios - 已启用 Google Places ApiKey 还显示无法在 iOS Swift 中加载搜索结果
- halide - 如何使用任何二元运算符示例 OR 或 AND、自定义函数来定义通用归约?
- php - PHP PDO SQLITE3, PDO::getAttribute ,警告:驱动程序不支持此功能
- python - python - 如何将字符串转换为数组并将数组中的每个十六进制值转换为python中的十进制?
- android - 当应用程序在 Flutter-Android 中处于前台时,UI 在收到推送通知时崩溃
- ag-grid - 如何从 Ag-Grid 上下文菜单中隐藏“导出”并替换“工具面板”?
- node.js - 为特定模式键创建唯一和修复 id
- pyspark - 使用 PrestoDB Query 未按计划运行 Airflow 任务
- reactjs - React-intl:为什么需要使用任何一个来定义消息
组件或 defineMessagesAPI 函数