Skip to content

Fixes some instruction in Intro #23

Fixes some instruction in Intro

Fixes some instruction in Intro #23

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- main # Change to your main branch name if different
jobs:
build:
runs-on: ubuntu-latest # We will continue to use a standard Ubuntu runner
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18' # Specify your Node.js version
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build # Replace with your actual build command
- name: Upload files via FTPES with recursive directory creation and curl
env:
FTPES_HOST: ${{ secrets.FTPES_HOST }}
FTPES_USERNAME: ${{ secrets.FTPES_USERNAME }}
FTPES_PASSWORD: ${{ secrets.FTPES_PASSWORD }}
run: |
find dist -type f | while read file; do
# Extract the directory part of the file path
dir=$(dirname "$file")
# Convert the local directory path to the FTP path
# remote_dir="${dir}"
remote_dir="$(dirname "$file" | sed 's|^dist||')"
echo $remote_dir
# # Create the directory on the FTP server if it doesn't exist
curl --ssl-reqd --user $FTPES_USERNAME:$FTPES_PASSWORD -Q "MKD $remote_dir" ftp://$FTPES_HOST
# Upload the file to the correct remote directory
curl -T "$file" --ssl-reqd --user $FTPES_USERNAME:$FTPES_PASSWORD ftp://$FTPES_HOST/$remote_dir/$(basename "$file")
done