diff --git a/.firebaserc b/.firebaserc deleted file mode 100644 index 9a3eda66..00000000 --- a/.firebaserc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "projects": { - "default": "jakejarvis-com" - } -} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 80c4a558..520fa431 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,20 +1,34 @@ -image: node:alpine - variables: HUGO_VERSION: '0.53' # https://github.com/gohugoio/hugo/releases HUGO_SHA: '0e4424c90ce5c7a0c0f7ad24a558dd0c2f1500256023f6e3c0004f57a20ee119' # xxx_Linux-64bit.tar.gz -before_script: - - apk update && apk add openssl coreutils - - wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz - - echo "${HUGO_SHA} hugo_${HUGO_VERSION}_Linux-64bit.tar.gz" | sha256sum -c - - tar xf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz && cp ./hugo /usr/bin - - npm config set unsafe-perm true - - npm install --quiet firebase-tools -g +stages: + - build + - deploy + +build: + stage: build + image: alpine:latest + script: + - apk update && apk add openssl coreutils + - wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz + - echo "${HUGO_SHA} hugo_${HUGO_VERSION}_Linux-64bit.tar.gz" | sha256sum -c + - tar xf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz && cp ./hugo /usr/bin + - rm -rf public + - hugo + artifacts: + paths: + - public deploy: stage: deploy + image: python:3.6-alpine + dependencies: + - build script: - - rm -rf public - - hugo - - firebase deploy --token $FIREBASE_TOKEN + - pip install awscli + - aws configure set preview.cloudfront true + - aws s3 sync ./public s3://$S3_BUCKET_NAME --delete --metadata-directive REPLACE + - aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*"; + only: + - master \ No newline at end of file diff --git a/firebase.json b/firebase.json deleted file mode 100644 index 0af558ee..00000000 --- a/firebase.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "hosting": { - "public": "public", - "ignore": [ - "firebase.json", - "**/.*", - "**/.git/**" - ], - "redirects": [ - { - "source": "/powncer.mov", - "destination": "/leo.mp4", - "type": 301 - }, - { - "source": "/powncer.mp4", - "destination": "/leo.mp4", - "type": 301 - } - ], - "headers": [ - { - "source": "**", - "headers": [ - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Strict-Transport-Security", - "value": "max-age=31536000; includeSubDomains; preload" - }, - { - "key": "Expect-CT", - "value": "max-age=0, report-uri=https://jarvis.report-uri.com/r/d/ct/reportOnly" - }, - { - "key": "Cache-Control", - "value": "max-age=86400, public" - }, - { - "key": "X-UA-Compatible", - "value": "IE=edge" - }, - { - "key": "X-XSS-Protection", - "value": "1; mode=block; report=https://jarvis.report-uri.com/r/d/xss/enforce" - }, - { - "key": "Content-Security-Policy", - "value": "default-src 'self'; script-src 'self' stats.jarv.is 'sha256-TLAu2p9kt4LHt+sWwE0cvqq1Ok5LoGzRPrw7+mzhX00='; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; frame-src 'self'; connect-src 'self' jarvis.report-uri.com stats.jarv.is; upgrade-insecure-requests; report-uri https://jarvis.report-uri.com/r/d/csp/enforce" - }, - { - "key": "Referrer-Policy", - "value": "no-referrer-when-downgrade" - }, - { - "key": "X-Frame-Options", - "value": "SAMEORIGIN" - }, - { - "key": "X-DNS-Prefetch-Control", - "value": "off" - } - ] - }, - { - "source": "**/*.@(css|js|pdf)", - "headers": [ - { - "key": "Cache-Control", - "value": "max-age=86400, public" - } - ] - }, - { - "source": "**/*.@(jpg|jpeg|gif|png|ico|mov|mp4)", - "headers": [ - { - "key": "Cache-Control", - "value": "max-age=2628000, public" - } - ] - }, - { - "source": "**/*.@(ttf|otf|woff|woff2|svg|eot)", - "headers": [ - { - "key": "Cache-Control", - "value": "max-age=31536000, public" - } - ] - }, - { - "source": "jarvis.asc", - "headers": [ - { - "key": "Cache-Control", - "value": "max-age=0, no-cache, no-store" - }, - { - "key": "Content-Type", - "value": "text/plain; charset=utf-8" - }, - { - "key": "Content-Disposition", - "value": "inline; filename=\"jarvis.asc\"" - } - ] - } - ] - } -} diff --git a/static/.gitkeep b/static/.gitkeep deleted file mode 100644 index e69de29b..00000000