~ekez/negativefour

1c357c441da7a7d3f5a3d3c4257d9958b81b87db — Zeke Medley 3 months ago 4157f87
Automatically deploy serve and www on push
1 files changed, 26 insertions(+), 6 deletions(-)

M .build.yml
M .build.yml => .build.yml +26 -6
@@ 1,19 1,39 @@
image: alpine/latest
oauth: pages.sr.ht/PAGES:RW
sources:
- https://git.sr.ht/~ekez/negativefour
secrets:
- 226db336-c96a-45eb-b55d-28cece902cb3
- d432e401-3d50-4498-965a-bb3387fbd436
tasks:
- package: |
- deploy-www: |
    ssh -i ~/.ssh/id_rsa -o "StrictHostKeyChecking no" admin@35.163.177.223 "
    cd negativefour
    tar -cvz . > ../site.tar.gz
- upload: |
    acurl -f https://pages.sr.ht/publish/negativefour.com -Fcontent=@site.tar.gz
    git checkout -- .
    git pull
    cd www
    npm install
    sudo systemctl restart negativefour.com"
- alert-www: |
    set +x
    curl \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"content":"'"negativefour [webpage](https://negativefour.com) deployment complete"'"}' \
    -d '{"content":"'"[negativefour.com](https://negativefour.com) deployment complete"'"}' \
    $(cat ~/.WEBHOOK_URL)
    set -x
- deploy-serve: |
    ssh -i ~/.ssh/id_rsa -o "StrictHostKeyChecking no" admin@35.163.177.223 "
    cd negativefour
    git checkout -- .
    git pull
    cd serve
    npm install
    sudo systemctl restart serve.negativefour.com"
- alert-serve: |
    set +x
    curl \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"content":"'"serve.negativefour.com deployment complete"'"}' \
    $(cat ~/.WEBHOOK_URL)
    set -x