Привки дизайна #22
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
name: Deploy | |
on: | |
push: | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [14] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Cleaning up the site directory before deployment | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_SERVER_IP }} | |
port: ${{ secrets.SSH_SERVER_PORT }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd ${{ secrets.SITE_DIR }} | |
rm -rf * | |
- name: Deploying the site | |
uses: easingthemes/[email protected] | |
with: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
REMOTE_HOST: ${{ secrets.SSH_SERVER_IP }} | |
REMOTE_USER: ${{ secrets.SSH_USER }} | |
REMOTE_PORT: ${{ secrets.SSH_SERVER_PORT }} | |
SOURCE: "site/" | |
TARGET: ${{ secrets.SITE_DIR }} | |
- name: Clearing the Cloudflare cache | |
uses: jakejarvis/cloudflare-purge-action@master | |
env: | |
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} | |
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} |