~evanj/ascii

ref: cebaab34a8eb0e1fb77768140a92cbc19924e7b9 ascii/.build.yml -rw-r--r-- 1.0 KiB
cebaab34Evan J Feat(*): Rework for traditional server deploy (moving from Vercel 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
image: debian/testing
packages:
  - make
  - golang
sources:
  - https://git.sr.ht/~evanj/ascii
secrets:
  - 0154a9d3-f2c9-4ee2-8102-7c4c92492149
tasks:
  - build: |
      export PATH=$PATH:$HOME/go/bin
      cd ascii
      touch .env
      make
      if [ `git branch | head -n 1 | awk '{print$5}' | sed 's/)//g' | xargs -I X bash -c "git log --pretty=oneline origin/master | head -n 1 | grep X" | wc -l` == "1" ]; then
        echo "deploying to production"
        ssh -p 4545 -o 'StrictHostKeyChecking=no' evan@140.82.14.80 'bash -c "sudo mysqldump ascii > \$(mktemp --suffix .ascii.datbase.backup.sql)"'
        ssh -p 4545 -o 'StrictHostKeyChecking=no' evan@140.82.14.80 'bash -c "rm ~/ascii/ascii 2>/dev/null"'
        scp -P 4545 -o 'StrictHostKeyChecking=no' ascii evan@140.82.14.80:~/ascii
        scp -P 4545 -r -o 'StrictHostKeyChecking=no' static evan@140.82.14.80:~/ascii
        ssh -p 4545 -o 'StrictHostKeyChecking=no' evan@140.82.14.80 'bash -c "sudo systemctl restart ascii"'
      else 
        echo "not deploying"
      fi