英文:
GIt hub actions
问题
我正在尝试设置一个GitHub Action来将/docs文件夹部署到Hostinger服务器。到目前为止,我尝试了以下步骤:
- 创建了一个子域名(lsmicro.descsimp.online)
- 创建了一个FTP帐户(ftp.descsimp.online)
- 在GitHub仓库根目录中创建了.github/workflow/main.yml文件,其代码如下:
name: 🚀 FTP Deploy
on:
push:
branches:
- main
jobs:
web-deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: FTP Deploy
uses: SamKirkland/FTP-Deploy-Action@4.3.4
with:
server: ftp.descsimp.online # 子域名名称?
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./docs/
remote-dir: ./public_html/lsmicro/
理论上,这应该在每次推送时将docs文件夹的内容复制到子域名文件夹/public_html/lsmicro/中。然而,到目前为止它没有推送任何内容。我的代码有错误吗?或者yml文件的放置位置有问题吗?还是其他什么原因?
谢谢。
英文:
I am trying to set a github action to deploy the /docs folder into a hostinger server.
so far I tried the following:
- created a subdomain (lsmicro.descsimp.online)
- created a FTP Account (ftp.descsimp.online)
- created .github/workflow/main.yml in the github repository root folder with the code:
name: 🚀 FTP Deploy
on:
push:
branches:
- main
jobs:
web-deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: FTP Deploy
uses: SamKirkland/FTP-Deploy-Action@4.3.4
with:
server: ftp.descsimp.online # Subdomain name?
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./docs/
remote-dir: ./public_html/lsmicro/
In theory this should copy the content of the docs folder into the subdomain folder /public_html/lsmicro/ on each push.
However, it does not push anything so far. Is there a mistake in my code? or the placement of the yml file? or anything else?
thank you
答案1
得分: 0
你的路径是错误的。应该是 .github/workflows
(注意末尾的 "s")。
你可以查看这份官方文档:https://docs.github.com/en/actions/quickstart#creating-your-first-workflow
英文:
Your path is wrong. It should be .github/workflows
(notice the trailing "s").
You can see this official document: https://docs.github.com/en/actions/quickstart#creating-your-first-workflow
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论