Create build-and-deploy.yml

This commit is contained in:
Erick Ruiz de Chavez 2021-09-22 11:44:36 -04:00 committed by GitHub
parent 66ac60dd82
commit 054aa5284a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

31
.github/workflows/build-and-deploy.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: Build and Deploy Site
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm ci
- run: npm run build --if-present
- name: Deploy site
uses: appleboy/scp-action@v0.1.1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: .htaccess,index.html,styles.css
target: /home/${{ secrets.USERNAME }}/sinsaludar.com
- name: Cloudflare Purge Cache
uses: jakejarvis/cloudflare-purge-action@v0.3.0
env:
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}