-
Notifications
You must be signed in to change notification settings - Fork 0
/
.build.yml
executable file
·85 lines (65 loc) · 1.88 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
image: debian/stable
packages:
- wget
sources:
- https://git.sr.ht/~retzoh/taskbot
environment:
REPOSITORY_NAME: taskbot
PACKAGE_NAME: taskbot
PACKAGE_FOLDER: taskbot
PACKAGE_PATH: .
GIT_SR_HT_URL: [email protected]:~retzoh/taskbot
GITHUB_URL: [email protected]:Retzoh/taskbot.git
secrets:
- ed37ce69-d5be-42df-9b92-41471089d431 # ~/.ssh/known_hosts
- 899472e5-1ec8-4211-a00b-05a0d3eaf775 # ~/.ssh/.github_deploy_ssh_key
- 7a15e00a-ada6-463e-a145-31c3297d95ec # ~/.cloudflare/api_keys
tasks:
- setup_nvm: |
wget -nv -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.buildenv
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> .buildenv
- setup_npm: |
nvm --version
nvm install node
npm install -g npx
- install_dependencies: |
npm --version
cd $REPOSITORY_NAME
npm install
npx elm --version
npx wrangler --version
- test: |
cd $REPOSITORY_NAME
npm run test_coverage
- build: |
cd $REPOSITORY_NAME
# npm run build
npm run make
npm run minify
npm run escape_code
npm run build_worker
- integration_tests: |
echo "TODO"
- deploy_master: |
ln -sf ~/.ssh/.build_test_ssh_key ~/.ssh/id_rsa
cd $REPOSITORY_NAME
git remote set-url origin $GIT_SR_HT_URL
lines=`git diff --stat origin/master..HEAD | wc -l`
if [ $lines -eq 0 ]
then
# deploy code
git config --global user.email "~retzoh/[email protected]"
git config --global user.name "Deploy"
ln -sf ~/.ssh/.github_deploy_ssh_key ~/.ssh/id_rsa
git checkout -B master -t origin/master
git remote set-url origin $GITHUB_URL
git push --set-upstream origin master
# deploy worker
set +x
. ~/.cloudflare/api_keys
set -x
npm run publish
else
echo "Aborting github deployment: HEAD is dirty compared to master."
fi