Skip to content

Add FTP deployment workflow for main branch#97

Open
1989shack wants to merge 1 commit intomainfrom
1989shack-patch-20
Open

Add FTP deployment workflow for main branch#97
1989shack wants to merge 1 commit intomainfrom
1989shack-patch-20

Conversation

@1989shack
Copy link
Owner

@1989shack 1989shack commented Dec 24, 2025

Summary by Sourcery

Deployment:

  • Introduce an FTP-based GitHub Actions deployment workflow that uploads the repository contents on pushes to the main branch.

Signed-off-by: Martin M Sheriff <smartin772@yahoo.com>
@codesandbox
Copy link

codesandbox bot commented Dec 24, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 24, 2025

Reviewer's Guide

Adds a GitHub Actions workflow that deploys the repository contents to an FTP server whenever changes are pushed to the main branch, using credentials stored in repository secrets.

Sequence diagram for GitHub push triggering FTP deployment workflow

sequenceDiagram
  actor Developer
  participant GitHub
  participant ActionsRunner
  participant FTPDeployAction
  participant FTPServer

  Developer->>GitHub: Push commit to main
  GitHub-->>ActionsRunner: Trigger workflow deploy yml
  ActionsRunner->>ActionsRunner: Checkout repo using actions_checkout_v4
  ActionsRunner->>FTPDeployAction: Invoke with server username password local_dir
  FTPDeployAction->>GitHub: Retrieve secrets FTP_HOST FTP_USER FTP_PASS
  FTPDeployAction->>FTPServer: Connect via FTP using credentials
  FTPDeployAction->>FTPServer: Upload files from local_dir ./
  FTPServer-->>FTPDeployAction: Acknowledge file uploads
  FTPDeployAction-->>ActionsRunner: Return deployment result
  ActionsRunner-->>GitHub: Report workflow status
Loading

File-Level Changes

Change Details Files
Introduce a GitHub Actions workflow to deploy main branch to an FTP server on push.
  • Create a new workflow triggered on pushes to the main branch
  • Define a single job that runs on ubuntu-latest and checks out the repository
  • Use SamKirkland/FTP-Deploy-Action to upload files over FTP using repository secrets for server, username, and password
  • Configure the action to upload the repository root directory and pass an insecure git-ftp argument
.github/workflows/deploy.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@appwrite
Copy link

appwrite bot commented Dec 24, 2025

1989shack.com

Project ID: e-commerce-free-web-hosting-platform

Sites (1)
Site Status Logs Preview QR
 1989shack.com
691b5ee800385b8bebac
Failed Failed View Logs Preview URL QR Code

Tip

GraphQL API works alongside REST and WebSocket protocols

@netlify
Copy link

netlify bot commented Dec 24, 2025

Deploy Preview for 1989shack-e-c failed. Why did it fail? →

Name Link
🔨 Latest commit 724cc45
🔍 Latest deploy log https://app.netlify.com/projects/1989shack-e-c/deploys/694b2d851311c0000826498c

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • Consider removing git-ftp-args: --insecure or documenting why it’s required, and instead configuring proper TLS on the FTP server to avoid weakening connection security.
  • You may want to restrict the workflow trigger with a paths: filter so that a push to main that only changes non-deployable files (e.g. README, tooling) doesn’t cause an unnecessary FTP deployment.
  • Double-check that local-dir: ./ is intentional; if the deployable assets live in a subdirectory (e.g., build/ or dist/), pointing local-dir there will avoid uploading unnecessary repository files to the FTP server.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider removing `git-ftp-args: --insecure` or documenting why it’s required, and instead configuring proper TLS on the FTP server to avoid weakening connection security.
- You may want to restrict the workflow trigger with a `paths:` filter so that a push to `main` that only changes non-deployable files (e.g. README, tooling) doesn’t cause an unnecessary FTP deployment.
- Double-check that `local-dir: ./` is intentional; if the deployable assets live in a subdirectory (e.g., `build/` or `dist/`), pointing `local-dir` there will avoid uploading unnecessary repository files to the FTP server.

## Individual Comments

### Comment 1
<location> `.github/workflows/deploy.yml:21` </location>
<code_context>
+          username: ${{ secrets.FTP_USER }}
+          password: ${{ secrets.FTP_PASS }}
+          local-dir: ./ # directory to upload (adjust if your site is in a subfolder)
+          git-ftp-args: --insecure
</code_context>

<issue_to_address>
**🚨 issue (security):** Reconsider `--insecure` as it disables TLS verification for FTP over SSL.

This flag disables certificate checks and should be avoided in routine deployments. If you truly need it for a specific host or environment, gate it behind a condition or config option so that normal runs use full TLS verification.
</issue_to_address>

### Comment 2
<location> `.github/workflows/deploy.yml:20` </location>
<code_context>
+          server: ${{ secrets.FTP_HOST }}
+          username: ${{ secrets.FTP_USER }}
+          password: ${{ secrets.FTP_PASS }}
+          local-dir: ./ # directory to upload (adjust if your site is in a subfolder)
+          git-ftp-args: --insecure
</code_context>

<issue_to_address>
**🚨 suggestion (security):** Uploading from `./` may unintentionally deploy workflow files and other project artifacts.

Using the repo root means everything gets uploaded, including `.github/`, config, and tooling files that shouldn’t be on the server. Prefer a dedicated build/output directory (e.g., `dist/`, `build/`), or at least configure `exclude`/`exclude-glob` to prevent internal files from being deployed.

Suggested implementation:

```
      - name: Upload files to FTP
        uses: SamKirkland/FTP-Deploy-Action@4.6.0
        with:
          server: ${{ secrets.FTP_HOST }}
          username: ${{ secrets.FTP_USER }}
          password: ${{ secrets.FTP_PASS }}
          # Use the build/output directory instead of the repo root to avoid deploying workflow/config files
          local-dir: ./dist
          # As an extra safeguard, exclude internal/tooling files if they end up in the output directory
          exclude: |
            .github/
            .git/
            .gitignore
            node_modules/
            **/*.test.*
            **/*.spec.*
          git-ftp-args: --insecure

```

1. Ensure your build step outputs the deployable site to `./dist` (or adjust `local-dir` to match your actual output directory, e.g. `build/`, `public/`).
2. If your project structure differs, update the `exclude` list to reflect directories/files that should never be deployed (e.g. `src/`, tooling configs, etc.).
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASS }}
local-dir: ./ # directory to upload (adjust if your site is in a subfolder)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 suggestion (security): Uploading from ./ may unintentionally deploy workflow files and other project artifacts.

Using the repo root means everything gets uploaded, including .github/, config, and tooling files that shouldn’t be on the server. Prefer a dedicated build/output directory (e.g., dist/, build/), or at least configure exclude/exclude-glob to prevent internal files from being deployed.

Suggested implementation:

      - name: Upload files to FTP
        uses: SamKirkland/FTP-Deploy-Action@4.6.0
        with:
          server: ${{ secrets.FTP_HOST }}
          username: ${{ secrets.FTP_USER }}
          password: ${{ secrets.FTP_PASS }}
          # Use the build/output directory instead of the repo root to avoid deploying workflow/config files
          local-dir: ./dist
          # As an extra safeguard, exclude internal/tooling files if they end up in the output directory
          exclude: |
            .github/
            .git/
            .gitignore
            node_modules/
            **/*.test.*
            **/*.spec.*
          git-ftp-args: --insecure

  1. Ensure your build step outputs the deployable site to ./dist (or adjust local-dir to match your actual output directory, e.g. build/, public/).
  2. If your project structure differs, update the exclude list to reflect directories/files that should never be deployed (e.g. src/, tooling configs, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant