forked from JabRef/jabref
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1.11 KB
/
cleanup_pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Cleanup after PR
on:
pull_request:
types: [closed]
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check secrets presence
id: checksecrets
shell: bash
run: |
if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then
echo ::set-output name=secretspresent::false
else
echo ::set-output name=secretspresent::true
fi
env:
BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }}
- name: Extract branch name
id: extract_branch
if: ${{ steps.checksecrets.outputs.secretspresent }}
run: |
echo "##[set-output name=branch;]$(echo ${{ github.event.pull_request.head.ref }})"
- name: Delete folder on builds.jabref.org
if: ${{ steps.checksecrets.outputs.secretspresent }}
uses: appleboy/ssh-action@v0.1.2
with:
script: rm -rf /var/www/builds.jabref.org/www/${{ steps.extract_branch.outputs.branch }} || true
host: build-upload.jabref.org
port: 9922
username: jrrsync
key: ${{ secrets.buildJabRefPrivateKey }}