1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-28 16:47:52 +02:00
market/scripts/deploy-s3.sh
Matthias Kretschmann a951f9bf3b
replace Travis with GitHub Actions workflow (#358)
* replace Travis with GitHub Actions workflow

* fix prettier on Windows

* remove PascalCasing bash one-liner for one use case

* use mkdirp to workaround Windows

* cache tweaks

* move s3 deploy to own workflow

* upload artifacts for debug

* path tweak

* debug

* apollo:codegen without folder pre-creation

* debug: activate s3 deploy for all branches

* pass env vars to deployment build

* more env var passing

* deploy main branch pushes only
2021-02-02 15:07:02 +02:00

43 lines
993 B
Bash
Executable File

#!/usr/bin/env bash
#
# required environment variables:
# AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY
# AWS_DEFAULT_REGION us-east-1
AWS_S3_BUCKET="www-market"
#
set -e;
function s3sync {
aws s3 sync ./public s3://"$1" \
--include "*" \
--exclude "*.html" \
--exclude "sw.js" \
--exclude "*page-data.json" \
--exclude "*app-data.json" \
--exclude "chunk-map.json" \
--exclude "sitemap.xml" \
--exclude ".iconstats.json" \
--exclude "robots.txt" \
--cache-control public,max-age=31536000,immutable \
--delete \
--acl public-read
aws s3 sync ./public s3://"$1" \
--exclude "*" \
--include "*.html" \
--include "sw.js" \
--include "*page-data.json" \
--include "*app-data.json" \
--include "chunk-map.json" \
--include "sitemap.xml" \
--include ".iconstats.json" \
--include "robots.txt" \
--cache-control public,max-age=0,must-revalidate \
--delete \
--acl public-read
}
s3sync $AWS_S3_BUCKET