From 90922af04fc10afc878467ed1e65053e424eb88f Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 27 Jan 2021 12:57:45 +0000 Subject: [PATCH] add release --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..351505c --- /dev/null +++ b/.github/workflows/release.yml @@ -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