From 054aa5284a5772faa261afa450f7f92a940a6cc7 Mon Sep 17 00:00:00 2001 From: Erick Ruiz de Chavez Date: Wed, 22 Sep 2021 11:44:36 -0400 Subject: [PATCH] Create build-and-deploy.yml --- .github/workflows/build-and-deploy.yml | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/build-and-deploy.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000..324e23e --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -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 }}