-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 1.08 KB
/
delete-preview.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
# documentation: https://github.com/deltachat/sysadmin/tree/master/delta.chat#github-action-to-copy-it-to-correct-location
name: Delete Preview Deliverables
on:
pull_request:
types: [closed]
jobs:
delete:
runs-on: ubuntu-latest
steps:
- name: Get Pullrequest ID
id: getid
run: |
export PULLREQUEST_ID=$(jq .number < $GITHUB_EVENT_PATH)
echo ::set-output name=prid::$PULLREQUEST_ID
- name: Generating error message
run: |
mkdir ${{ steps.getid.outputs.prid }}
# create empty file to copy it over the outdated deliverable on download.delta.chat
echo "This preview is outdated and has been removed." > ${{ steps.getid.outputs.prid }}/index.html
- name: Replace build with error message
uses: AEnterprise/rsync-deploy@v1.0
env:
DEPLOY_KEY: ${{ secrets.KEY }}
USERNAME: ${{ secrets.USERNAME }}
SERVER_PORT: 22
FOLDER: ${{ steps.getid.outputs.prid }}
SERVER_IP: staging.bots.delta.chat
SERVER_DESTINATION: /var/www/html/bot-staging/
ARGS: --delete -vhr