-
Notifications
You must be signed in to change notification settings - Fork 41
46 lines (40 loc) · 1.22 KB
/
hds-demo-preview-clean.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
37
38
39
40
41
42
43
44
45
46
name: hds-demo-preview-clean
on:
pull_request:
branches:
- development
- release-*
- 'feature/*'
types:
- closed
jobs:
build_and_publish_demo:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout code hds-demo
uses: actions/checkout@v4
with:
repository: City-of-Helsinki/hds-demo
path: hds-demo
ssh-key: ${{ secrets.HDSDEMO_SSH_DEPLOY_KEY }}
- name: Remove PR directory
id: remove_preview
run: |
if [ -d "./docs/preview_${{ github.event.number }}" ] ; then
rm -fr ./docs/preview_${{ github.event.number }}
echo "preview_exists=true" >> $GITHUB_OUTPUT
else
echo "preview_exists=false" >> $GITHUB_OUTPUT
fi
working-directory: ./hds-demo
- name: Commit
if: steps.remove_preview.outputs.preview_exists == 'true'
run: |
git config --global user.email "hds@hel.fi"
git config --global user.name "Github Actions"
git status
git add .
git commit -m "Updated pr ${{ github.event.number }}"
git push
working-directory: ./hds-demo