-
Notifications
You must be signed in to change notification settings - Fork 0
/
.build.yml
41 lines (41 loc) · 1.23 KB
/
.build.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
image: alpine/edge
packages:
- rsync
- deno
- git-cliff
environment:
deploy: [email protected]
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no
secrets:
- 0323bc6f-a046-4b96-8496-2bac6e7ee107
sources:
- [email protected]:~timharek/filmpolitiet-api
triggers:
- action: email
condition: failure
tasks:
- setup: |
echo 'cd filmpolitiet-api' >> ~/.buildenv
- test: |
deno task check
deno task test
- mirror: |
git push --force --mirror [email protected]:timharek/filmpolitiet-api.git
- check_release: |
tag=$(git describe --exact-match --tags HEAD 2>/dev/null || true)
if [ -z "$tag" ]; then
echo "Current commit is not a tag: not a new release"
complete-build
fi
- update_changelog: |
git checkout main
git cliff -o CHANGELOG.md
git add CHANGELOG.md
git commit -m "chore(release): Update CHANGELOG"
git push -o skip-ci
- deploy: |
git --no-pager log -1 --format=%ci > last_deploy
sshopts="ssh -o StrictHostKeyChecking=no"
rsync --rsh="$sshopts" -avrP --exclude "last_deploy" . $deploy:/var/www/filmpolitiet.wyd.no
rsync --rsh="$sshopts" -avrP last_deploy $deploy:/var/www/filmpolitiet.wyd.no/last_deploy