简体   繁体   English

GitHub cpanel 存储库的工作流程

[英]GitHub workflow for cpanel repository

I need help setting up a GitHub workflow so anytime I push to my GitHub repository the changes will be automatically pushed to my cpanel repository.我需要帮助来设置 GitHub 工作流程,因此只要我推送到我的 GitHub 存储库,更改就会自动推送到我的 cpanel 存储库。 I think this will be a better option than pushing to both GitHub and cpanel repository.我认为这将是比推送到 GitHub 和 cpanel 存储库更好的选择。 This will also be helpful when multiple developers are working on the project and I would not have to share the password everytime.当多个开发人员正在从事该项目时,这也将很有帮助,而且我不必每次都共享密码。

Deploying files to hosted websites through ftp通过ftp部署文件到托管网站

Your cpanel should accept ftp or sftp.您的 cpanel 应该接受 ftp 或 sftp。 So you can create a username/password with access to your cpanel directory and create a workflow like the below to push to it.因此,您可以创建一个可以访问您的 cpanel 目录的用户名/密码,并创建一个如下所示的工作流来推送到它。 The below user action will push to ftp on every commit.以下用户操作将在每次提交时推送到 ftp。

Here are the docs on the github action that gets used below https://github.com/SamKirkland/FTP-Deploy-Action以下是在 https 下面使用的 github 操作的文档://github.com/SamKirkland/FTP-Deploy-Action

 name: FTP Test
 on:
   push:
 jobs:
   ci:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
       - name: FTP-Deploy-Action
         uses: SamKirkland/FTP-Deploy-Action@3.1.1
         with:
           ftp-server: ${{ secrets.SFTP_SERVER }}
           ftp-username: ${{ secrets.FTP_USERNAME }}
           ftp-password: ${{ secrets.FTP_PASSWORD }}
           local-dir: toupload

Deploying to a git cpanel hosted repo部署到 git cpanel 托管的 repo

In this pipeline we are basically checking out the github code, and then changing the origin so that we can push code directly into CPANEL and commiting the code.在此管道中,我们基本上是检出 github 代码,然后更改来源以便我们可以将代码直接推送到 CPANEL 并提交代码。

 name: Push To CPanel Git
 on:
   push:
 jobs:
   ci:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
       - name: Push to git repo
         run: |
             git remote set-url --add --push origin ssh://username@hostname/home/username/Project/example.git
             git add .
             git commit -m "Push to cPanel"
             git push https://${{ secrets.GITHUB_TOKEN }}@domain.com/username/example.git -f

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用.cpanel.yml 在 Github 存储库中推送后自动更新 cpanel - Automatically update cpanel after push in Github Repository with .cpanel.yml 如何使用 github 操作从 Github 中的存储库 A 的工作流作业触发存储库 B(下游作业)中的工作流作业 - How to trigger a workflow job in repository B(downstream job) from workflow job of repository A in Github using github actions 多个(超过 1 个)私有 Github 存储库连接到 cpanel - 无法创建第二个 cpanel 存储库 - Multiple (more than 1) private Github repos connected to cpanel - cannot create a second cpanel repository github工作流 - 致命:不是git存储库(或任何父目录):。git - github workflow - fatal: not a git repository (or any of the parent directories): .git 使用AWS EC2服务器的GitHub Git存储库工作流程? - GitHub Git Repository Workflow With an AWS EC2 Server? 如何在 github 操作工作流 ci 中通过 npm 安装私有 github 存储库 - How to install private github repository via npm in github actions workflow ci 在 cPanel 上克隆 Azure 存储库 - Clone Azure Repository on cPanel github集成工作流程:当贡献者将更改推送到“受祝福的存储库”时会发生什么? - github integration workflow: what happened when contributor push changes to the “blessed repository”? 如何让 github 操作工作流使用机器人名称将生成的文档推送到同一组织中的其他存储库 - How let github actions workflow push generated documentation to other repository in same organization using a bot name github桌面如何与cpanel连接 - How to connect github desktop with cpanel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM