-
Notifications
You must be signed in to change notification settings - Fork 0
/
.build.yml
37 lines (36 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
image: alpine/edge
packages:
- deno
- rsync
environment:
deploy: [email protected]
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no
secrets:
- 0323bc6f-a046-4b96-8496-2bac6e7ee107
sources:
- https://git.sr.ht/~timharek/timharek.no
triggers:
- action: email
condition: failure
tasks:
- setup: |
echo 'cd timharek.no' >> ~/.buildenv
- test: |
deno test -A
deno task check
- nopr: |
[ "$BUILD_SUBMITTER" = 'git.sr.ht' ] || complete-build
- check: |
if [ "$(git rev-parse origin/main)" != "$(git rev-parse HEAD)" ]; then \
complete-build; \
fi
- mirror: |
git push --force --mirror [email protected]:timharek/timharek.no.git
# FIXME: There is a problem with Codeberg unless pushed after SSHing onto the failed build
# git push --force --mirror [email protected]:timharek/timharek.no.git
- deploy: |
git --no-pager log -1 --format=%ci > last_deploy
sshopts="ssh -o StrictHostKeyChecking=no"
rsync --rsh="$sshopts" -avrP --exclude "last_deploy" --exclude ".git" --exclude "node_modules" --exclude ".env*" --delete . $deploy:/var/www/timharek.no
rsync --rsh="$sshopts" -avrP last_deploy $deploy:/var/www/timharek.no/last_deploy