2020-06-16 04:24:13 +02:00
|
|
|
args@{ pkgs, ... }:
|
|
|
|
with pkgs;
|
2020-06-16 02:44:06 +02:00
|
|
|
let
|
2020-06-16 04:24:13 +02:00
|
|
|
site = import ./site.nix args;
|
2020-11-16 17:01:28 +01:00
|
|
|
resume = import ../resume args;
|
2020-06-16 02:44:06 +02:00
|
|
|
bucket = "s3://gws.fyi";
|
|
|
|
distributionID = "E2ST43JNBH8C64";
|
|
|
|
website =
|
|
|
|
runCommand "gws.fyi" { } ''
|
|
|
|
mkdir -p $out
|
2020-06-16 04:24:13 +02:00
|
|
|
cp ${site.index} $out/index.html
|
2020-11-16 17:01:28 +01:00
|
|
|
cp ${resume} $out/resume.pdf
|
2020-06-16 02:44:06 +02:00
|
|
|
'';
|
2020-06-16 04:24:13 +02:00
|
|
|
|
2020-06-16 02:44:06 +02:00
|
|
|
in writeShellScript "deploy.sh" ''
|
|
|
|
${awscli}/bin/aws s3 sync ${website}/ ${bucket}
|
|
|
|
${awscli}/bin/aws cloudfront create-invalidation \
|
|
|
|
--distribution-id "${distributionID}" \
|
|
|
|
--paths "/*"
|
|
|
|
echo "Deployed to http://gws.fyi"
|
|
|
|
''
|