try again #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Generate filelist.txt | |
# run: | | |
# # Create filelist.txt with all files in the build directory | |
# find dist -type f > filelist.txt | |
# cat filelist.txt # This prints out the contents of the file to the logs for verification | |
# - name: Upload files via FTPES using filelist.txt | |
# env: | |
# FTPES_HOST: ${{ secrets.FTPES_HOST }} | |
# FTPES_USERNAME: ${{ secrets.FTPES_USERNAME }} | |
# FTPES_PASSWORD: ${{ secrets.FTPES_PASSWORD }} | |
# run: | | |
# # Upload files listed in filelist.txt using curl | |
# for file in $(cat filelist.txt); do | |
# curl -T "$file" --ssl-reqd --user $FTPES_USERNAME:$FTPES_PASSWORD ftp://$FTPES_HOST | |
# done | |
- name: Install lftp | |
run: sudo apt-get install -y lftp | |
- name: Upload files via FTPES using lftp | |
env: | |
FTPES_HOST: ${{ secrets.FTPES_HOST }} | |
FTPES_USERNAME: ${{ secrets.FTPES_USERNAME }} | |
FTPES_PASSWORD: ${{ secrets.FTPS_PASSWORD }} | |
run: | | |
lftp -u $FTPES_USERNAME,$FTPES_PASSWORD -e "set ftp:ssl-allow yes; | |
set xfer:log 1; | |
mirror -R dist/ .; | |
quit" | |
ftp://$FTPES_HOST |