@@ -25,52 +25,51 @@ jobs:
2525 [[ -z "$release" ]] && echo "Build Successful; no release" >&2 && exit 0
2626 echo "RELEASE=$release" >> $GITHUB_ENV
2727 echo "IMAGE=$image" >> $GITHUB_ENV
28- # - name: sshagent
29- # uses: webfactory/[email protected] 30- # with:
31- # ssh-private-key: ${{ secrets.SSHKEY }}
32- # - name: deploy
33- # if: ${{ env.RELEASE }}
34- # run: |
35- # sudo npm install -g @treehouses/cli
36- # export gitter_channel="${{ secrets.CHANNEL }}"
37- # image=${{ env.IMAGE }}
38- # release=${{ env.RELEASE }}
39- # release_is_number() { echo "$release" | grep -Eqx "[0-9]+" ; }
40- # architecture=${{ matrix.arch }}
41- # name="treehouse-$release-arm64"
42- # image_gz="$name.img.gz"
43- # image_sha1=$image_gz.sha1
44- # image_dir="experiment/"
45- # if release_is_number; then
46- # image_dir=""
47- # fi
48- # echo "compressing ..."
49- # gzip -c -9 < "$image" > "$image_gz"
50- # sync
51- # echo "hashing ..."
52- # sha1sum "$image_gz" > "$image_sha1"
53- # sync
54- # echo "${{ secrets.AWSACCESSKEYID }}:${{ secrets.AWSACCESSKEYSECRET }}" > .passwd-s3fs
55- # chmod 600 .passwd-s3fs
56- # sudo rm -rf /var/www/html
57- # sudo mkdir -p /var/www/html
58- # sudo chmod 666 /var/www/html
59- # echo "uploading ..."
60- # sudo s3fs treehouses /var/www/html -o passwd_file=./.passwd-s3fs -o allow_other
61- # sudo cp "$image_gz" "$image_sha1" "/var/www/html/$image_dir"
62- # echo "treehouses image http://download.treehouses.io/$image_dir$image_gz"
63- # treehouses feedback "treehouses image http://download.treehouses.io/$image_dir$image_gz"
64- # mkdir -p ~/.ssh
65- # chmod 700 ~/.ssh
66- # echo "download.ole.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK6diybdi0R/Iptq9qGSP/ZU5zaJ8XrfGSuGvmsVFGKdQAPJsS4GhRm4cq8ucAYoatz9gx/mgJBWgPV6JPbkxiU=" > ~/.ssh/known_hosts
67- # echo "backuping ..."
68- # rsync -Pav "$image_gz" "$image_sha1" [email protected] :/data/images/69- # if release_is_number; then
70- # echo "Marking release as latest image"
71- # ssh [email protected] sh -c ":; cd /data/images; ln -sf $name.img.gz latest.img.gz; ln -sf $name.img.gz.sha1 latest.img.gz.sha1"72- # fi
73- # echo "Download url: http://download.treehouses.io/$image_dir$image_gz"
28+ - name : sshagent
29+ uses :
webfactory/[email protected] 30+ with :
31+ ssh-private-key : ${{ secrets.SSHKEY }}
32+ - name : deploy
33+ if : ${{ env.RELEASE }}
34+ run : |
35+ sudo npm install -g @treehouses/cli
36+ #export gitter_channel="${{ secrets.CHANNEL }}"
37+ image=${{ env.IMAGE }}
38+ release=${{ env.RELEASE }}
39+ release_is_number() { echo "$release" | grep -Eqx "[0-9]+" ; }
40+ name="treehouse-$release-arm64"
41+ image_gz="$name.img.gz"
42+ image_sha1=$image_gz.sha1
43+ image_dir="experiment/"
44+ if release_is_number; then
45+ image_dir=""
46+ fi
47+ echo "compressing ..."
48+ gzip -c -9 < "$image" > "$image_gz"
49+ sync
50+ echo "hashing ..."
51+ sha1sum "$image_gz" > "$image_sha1"
52+ sync
53+ echo "${{ secrets.AWSACCESSKEYID }}:${{ secrets.AWSACCESSKEYSECRET }}" > .passwd-s3fs
54+ chmod 600 .passwd-s3fs
55+ sudo rm -rf /var/www/html
56+ sudo mkdir -p /var/www/html
57+ sudo chmod 666 /var/www/html
58+ echo "uploading ..."
59+ sudo s3fs treehouses /var/www/html -o passwd_file=./.passwd-s3fs -o allow_other
60+ sudo cp "$image_gz" "$image_sha1" "/var/www/html/$image_dir"
61+ echo "treehouses image http://download.treehouses.io/$image_dir$image_gz"
62+ #treehouses feedback "treehouses image http://download.treehouses.io/$image_dir$image_gz"
63+ #mkdir -p ~/.ssh
64+ #chmod 700 ~/.ssh
65+ #echo "download.ole.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK6diybdi0R/Iptq9qGSP/ZU5zaJ8XrfGSuGvmsVFGKdQAPJsS4GhRm4cq8ucAYoatz9gx/mgJBWgPV6JPbkxiU=" > ~/.ssh/known_hosts
66+ #echo "backuping ..."
67+ #rsync -Pav "$image_gz" "$image_sha1" [email protected] :/data/images/ 68+ #if release_is_number; then
69+ # echo "Marking release as latest image"
70+ # ssh [email protected] sh -c ":; cd /data/images; ln -sf $name.img.gz latest.img.gz; ln -sf $name.img.gz.sha1 latest.img.gz.sha1" 71+ #fi
72+ echo "Download url: http://download.treehouses.io/$image_dir$image_gz"
7473# - name: apache index
7574# if: ${{ env.RELEASE }}
7675# run: |
0 commit comments