π Deploy website on push #16
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
on: | |
schedule: | |
- cron: '0 8,12,18,20 * * *' # This runs the scheduled job multiple times a day. | |
push: | |
branches: | |
- main # This runs the push job when there's a push to the 'main' branch. | |
name: π Deploy website on push | |
jobs: | |
web-deploy: | |
name: π Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Get latest code | |
uses: actions/[email protected] | |
- name: Build to production | |
run: | | |
npm install | |
npm install -g gatsby | |
npm run build | |
- name: π Sync files | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
local-dir: ./public/ |