-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e5b2ec
commit 90922af
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Deploy on staging | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
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_PRODUCTION_PATH }} | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v2 | ||
- name: Add NodeJs | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12" | ||
- name: Install pmpm | ||
run: npm add -g pnpm | ||
- name: Build the project | ||
run: | | ||
pnpm install | ||
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 |