Skip to content

[pull] main from activepieces:main #379

[pull] main from activepieces:main

[pull] main from activepieces:main #379

name: Remove Environment
on:
pull_request:
types: [closed]
jobs:
Remove-Preview-Environment:
runs-on: ubuntu-latest
if: github.repository == 'activepieces/activepieces' && github.event.pull_request.head.repo.full_name == 'activepieces/activepieces'
env:
NX_NO_CLOUD: true
steps:
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/preview-server.key
chmod 600 ~/.ssh/preview-server.key
cat >>~/.ssh/config <<END
Host preview-server
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/preview-server.key
StrictHostKeyChecking no
END
env:
SSH_USER: ${{ secrets.PRE_PROD_USERNAME }}
SSH_KEY: ${{ secrets.PREVIEW_SSH_KEY }}
SSH_HOST: ${{ secrets.PREVIEW_HOST }}
- name: Remove Environment
run: |
ssh preview-server -t -t 'bash -ic "cd /root/environments && npm run build && node dist/index.js remove ${{ github.head_ref }}; exit"'