An example of deploying a react project using FTP-Deploy-Action. The following example should work for most frameworks (angular, react, vue, etc)
You can see the results of this deployment by going to ftp-deploy-action-example-react.samkirkland.com
To add a secret
go to the Settings
tab in your project then select Secrets
. Add a new Secret
for each of the following
Secret Key Name | Value |
---|---|
server | ftp.samkirkland.com |
username | react-deploy-example@ftp-deploy-action-example-react.samkirkland.com |
password | YourPasswordHere |
local-dir | build/ |
The following is the exact contents of FTP-Deploy-Action-Example-React/.github/workflows/main.yml
file
on: push
name: π Deploy website on push
jobs:
web-deploy:
name: π Deploy
runs-on: ubuntu-latest
steps:
- name: π Get latest code
uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: π¨ Build Project
run: |
npm install
npm run build
- name: List output files
run: find build/ -print
- name: π Sync files
uses: SamKirkland/FTP-Deploy-Action@4.1.0
with:
server: ftp.samkirkland.com
username: react-deploy-example@ftp-deploy-action-example-react.samkirkland.com
password: ${{ secrets.FTP_PASSWORD }}
local-dir: build/