Last active
January 8, 2023 16:22
-
-
Save anlisha-maharjan/7b940aa49c214a40e99dfe00c213198a to your computer and use it in GitHub Desktop.
Deploy React app on shared hosting with FTP Deploy GitHub Action.
This file contains hidden or 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: π Deploy on push master | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
web-deploy: | |
name: π Deploy | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: π Get latest code | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@master | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Copy .env.prod.example to .env | |
run: cp .env.prod.example .env | |
- 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.3.3 | |
with: | |
server: ${{ secrets.SERVER }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
local-dir: build/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment