Download the contents of a public GitHub repo and then save to S3. Sets file policy to public.
Works well when paired with a GitHub webhook. Makes it easy to automatically update static sites served on S3, or static files on Cloudfront CDN, after each push.
Feel free to use this service directly, or click fork to deploy your own personal version.
Finish the setup steps to use Upload Public GitHub Repo to S3 in Slack.
Run this function with a POST request to Blockspring.
Visit the node.js quickstart to get started fast.
Visit the php quickstart to get started fast.
Visit the python quickstart to get started fast.
Visit the ruby quickstart to get started fast.
Visit the r quickstart to get started fast.
Visit the javascript quickstart to get started fast.
Use this URL for webhooks. You'll want to make a POST request.
curl -H "Content-Type: application/json" -d "{ \"repo_author\": , \"repo_name\": , \"bucket\": , \"aws_access_key\": , \"aws_secret_key\": }" "https://run.blockspring.com/api_v2/blocks/github-repo-to-s3?"
var blockspring = require("blockspring");
blockspring.runParsed("github-repo-to-s3", { "repo_author": , "repo_name": , "bucket": , aws_access_key: , aws_secret_key: }, function(res) {
console.log(res.params);
});
var request = require("request");
request.post({
url: "https://run.blockspring.com/api_v2/blocks/github-repo-to-s3?",
form: { "repo_author": , "repo_name": , "bucket": , aws_access_key: , aws_secret_key: }
},
function(err, response, body) {
console.log(JSON.parse(body));
});
<?php
$url = 'https://run.blockspring.com/api_v2/blocks/github-repo-to-s3?';
$data = json_encode(array("repo_author" => , "repo_name" => , "bucket" => , "aws_access_key" => , "aws_secret_key" => ));
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => array("Accept: application/json", "Content-Type: application/json"),
'method' => 'POST',
'content' => $data,
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump(json_decode($result));
?>
<?php
require('blockspring.php');
var_dump(Blockspring::runParsed("github-repo-to-s3", array("repo_author" => , "repo_name" => , "bucket" => , "aws_access_key" => , "aws_secret_key" => ))->params);
import json
import urllib2
req = urllib2.Request("https://run.blockspring.com/api_v2/blocks/github-repo-to-s3?")
req.add_header('Content-Type', 'application/json')
data = { "repo_author": , "repo_name": , "bucket": , "aws_access_key": , "aws_secret_key": }
results = urllib2.urlopen(req, json.dumps(data)).read()
print json.loads(results)
import blockspring
import json
print blockspring.runParsed("github-repo-to-s3", { "repo_author": , "repo_name": , "bucket": , "aws_access_key": , "aws_secret_key": }).params
require 'rest_client'
response = RestClient.post 'https://run.blockspring.com/api_v2/blocks/github-repo-to-s3?', JSON.dump({ "repo_author" => , "repo_name" => , "bucket" => , "aws_access_key" => , "aws_secret_key" => }), :content_type => :json
puts JSON.load(response)
require 'blockspring'
puts Blockspring.runParsed("github-repo-to-s3", { "repo_author" => , "repo_name" => , "bucket" => , "aws_access_key" => , "aws_secret_key" => } ).params
require 'rest_client'
response = RestClient.post 'https://run.blockspring.com/api_v2/blocks/github-repo-to-s3?', JSON.dump({ "repo_author" = , "repo_name" = , "bucket" = , "aws_access_key" = , "aws_secret_key" = }), :content_type => :json
puts JSON.load(response)
library('blockspring')
library('rjson')
print(blockspringRunParsed("github-repo-to-s3", list( "repo_author" = , "repo_name" = , "bucket" = , "aws_access_key" = , "aws_secret_key" = ))$params)
<script src="https://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="https://cdn.blockspring.com/blockspring.js"></script>
<script>
blockspring.runParsed("github-repo-to-s3", { "repo_author": , "repo_name": , "bucket": , aws_access_key: , aws_secret_key: }, { "api_key": "" }, function(res){
console.log(res.params);
})
</script>
https://run.blockspring.com/api_v2/blocks/github-repo-to-s3?
Finish the setup steps to use Upload Public GitHub Repo to S3 in Code.