mirror of
https://github.com/netbootxyz/netboot.xyz.git
synced 2026-01-23 02:34:26 +00:00
With the recent changes to Travis CI, it seemed like a good time to begin porting netboot.xyz CI over to Github Actions to keep everything in on place. These are the changes for the main netboot.xyz repo.
41 lines
1.4 KiB
Bash
Executable file
41 lines
1.4 KiB
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
TYPE=$1
|
|
|
|
if [ "${TYPE}" == "dev-push" ]; then
|
|
BOOT_URL="https://s3.amazonaws.com/dev.boot.netboot.xyz/${GITHUB_SHA}/index.html"
|
|
elif [ "${TYPE}" == "rc-push" ]; then
|
|
BOOT_URL="https://staging.boot.netboot.xyz/$(cat version.txt)-RC/index.html"
|
|
elif [ "${TYPE}" == "live-push" ]; then
|
|
BOOT_URL="https://boot.netboot.xyz/$(cat version.txt)/index.html"
|
|
fi
|
|
|
|
# send status to discord
|
|
if [ "${TYPE}" == "failure" ]; then
|
|
curl -X POST -H "Content-Type: application/json" --data \
|
|
'{
|
|
"avatar_url": "https://unavatar.now.sh/twitter/github",
|
|
"embeds": [
|
|
{
|
|
"color": 16711680,
|
|
"description": "__**Failed to Build**__ \n**Build:** 'https://github.com/netbootxyz/netboot.xyz/actions/runs/${GITHUB_RUN_ID}'\n**Status:** Failure\n**Change:** https://github.com/netbootxyz/netboot.xyz/commit/'${GITHUB_SHA}'\n"
|
|
}
|
|
],
|
|
"username": "Github"
|
|
}' \
|
|
${DISCORD_HOOK_URL}
|
|
else
|
|
curl -X POST -H "Content-Type: application/json" --data \
|
|
'{
|
|
"avatar_url": "https://unavatar.now.sh/twitter/github",
|
|
"embeds": [
|
|
{
|
|
"color": 1681177,
|
|
"description": "__**Boot Menu Published**__ \n**Files:** '${BOOT_URL}' \n**Build:** 'https://github.com/netbootxyz/netboot.xyz/actions/runs/${GITHUB_RUN_ID}'\n**Change:** https://github.com/netbootxyz/netboot.xyz/commit/'${GITHUB_SHA}'\n"
|
|
}
|
|
],
|
|
"username": "Github"
|
|
}' \
|
|
${DISCORD_HOOK_URL}
|
|
fi
|