Skip to content

Instantly share code, notes, and snippets.

@antonbabenko
Created September 17, 2020 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonbabenko/e61482fa3cfbf8a0810b1b8367b1396b to your computer and use it in GitHub Desktop.
Save antonbabenko/e61482fa3cfbf8a0810b1b8367b1396b to your computer and use it in GitHub Desktop.
Show GitHub sponsors as markdown using apex-up
git clone git@github.com:tj/sponsors-api.git
cd sponsors-api
# Install up ( https://github.com/apex/up )
curl -sf https://up.apex.sh/install | sh
# Build the binary
GOOS=linux GOARCH=amd64 go build -o server cmd/sponsors-api/main.go
# Create config for up
UP_URL=$(up url) # this will be empty for the first run because API Gateway is not yet created
cat > up.json <<EOF
{
"name": "sponsors-api",
"regions": [
"eu-west-1"
],
"environment": {
"GITHUB_TOKEN": "$(secrethub read antonbabenko/private/github)",
"URL": "$UP_URL"
}
}
EOF
# Switch to correct AWS profile:
aws-vault exec --debug --no-session private-anton
# Deploy it live
up
open $(up url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment