Merge pull request #89 from Codeinwp/dependabot/npm_and_yarn/follow-r… #85
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 staging | |
on: | |
push: | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
SSH_USERNAME: ${{ secrets.PAGELY_SSH_USER }} | |
SSH_KEY: ${{ secrets.PAGELY_SSH_KEY }} | |
SSH_PORT: ${{ secrets.PAGELY_SSH_PORT }} | |
SSH_HOST: ${{ secrets.PAGELY_SSH_HOST }} | |
SSH_PATH: ${{ secrets.SSH_STAGING_PATH }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Add NodeJs | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "12" | |
- name: Installnode_module | |
run: npm ci | |
- name: Build the project | |
run: npm run plugin-build | |
- name: Add SSH Key | |
run: | | |
mkdir $HOME/.ssh | |
echo "$SSH_KEY" > "$HOME/.ssh/key" | |
chmod 600 "$HOME/.ssh/key" | |
- name: Deploy on server | |
run: | | |
rsync -rc --delete --exclude-from="$GITHUB_WORKSPACE/.distignore" -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" "$GITHUB_WORKSPACE/" $SSH_USERNAME@$SSH_HOST:$SSH_PATH |