Learn how to connect your deployment script to your FTP server via SFTP. Nate explains the code required and covers how to keep passwords and connection information secure with environment variables.
- [Instructor] Let's create the deploy dot js script.…I'll do new file call it, "deploy dot js"…And we'll start writing the code that we need.…I'll start by…doing const…SftpClient…equals require…ssh…to SftpClient, which is one of the packages we grabbed…via NPM.…I'll also do next…sftp…equals new…SftpClient.…I'm going to declare a variable called, "items to upload".…
We'll come back to this in a sec,…but first I want to have the sftp client connect to…the server.…I'll do sftp dot connect…and passes some…connection information.…You'll specify a host…and I'm going to not hard code the host,…but I'm going to do process dot env dot ftp underscore deploy…underscore host.…That'll pull a value from environment variables…and I'll show you how to hook that up a little bit later.…I'm going to do the same thing for port.…
Ftp deploy port…and for username and password as well.…Password comes from process dot env like the other ones.…Ftp underscore deploy underscore password.…Storing connection information especially passwords…in an environment variables is much better than storing…
- Advantages of static sites
- Installing Hugo and Git
- Creating a new Hugo site
- Building a new website
- Adding posts, pages, and static content
- Publishing your static site
- Deploying via FTP, AWS, and Netlify
Skill Level Beginner
Amazon Web Services: Storage and Data Managementwith Brandon Rich3h 50m Intermediate
1. How Static Sites Work
2. Set Up Hugo
3. Build a Website
4. Prepare for Publishing
5. Deploy via FTP
6. Deploy to AWS
7. Deploy with Netlify
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.