GitHub Actions

huangapple go评论52阅读模式
英文:

GIt hub actions

问题

我正在尝试设置一个GitHub Action来将/docs文件夹部署到Hostinger服务器。到目前为止,我尝试了以下步骤:

  1. 创建了一个子域名(lsmicro.descsimp.online)
  2. 创建了一个FTP帐户(ftp.descsimp.online)
  3. 在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:

  1. created a subdomain (lsmicro.descsimp.online)
  2. created a FTP Account (ftp.descsimp.online)
  3. 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

huangapple
  • 本文由 发表于 2023年7月13日 15:27:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76676906.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定