mirror of
https://github.com/offen/website.git
synced 2024-11-22 01:00:26 +01:00
ensure better logical grouping of build steps
This commit is contained in:
parent
f13d9648f0
commit
802249a33c
@ -10,22 +10,31 @@ jobs:
|
|||||||
- setup_remote_docker
|
- setup_remote_docker
|
||||||
- aws-cli/install
|
- aws-cli/install
|
||||||
- run:
|
- run:
|
||||||
name: Build and deploy to S3
|
name: Set build environment depending on branch
|
||||||
command: |
|
command: |
|
||||||
if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
||||||
|
cat >> $BASH_ENV \<< EOF
|
||||||
export SITEURL="https://www.offen.dev"
|
export SITEURL="https://www.offen.dev"
|
||||||
export BUCKET="offen-dev-production"
|
export BUCKET="offen-dev-production"
|
||||||
export DISTRIBUTION="E2UP8XHLFOC3QC"
|
export DISTRIBUTION="E2UP8XHLFOC3QC"
|
||||||
export ROBOTS_FILE="robots.txt.production"
|
export ROBOTS_FILE="robots.txt.production"
|
||||||
export OFFEN_ACCOUNT_ID="5ec8345a-2a45-4eb9-92e5-8d9e5684db58"
|
export OFFEN_ACCOUNT_ID="5ec8345a-2a45-4eb9-92e5-8d9e5684db58"
|
||||||
|
EOF
|
||||||
else
|
else
|
||||||
|
cat >> $BASH_ENV \<< EOF
|
||||||
export SITEURL="https://staging.offen.dev"
|
export SITEURL="https://staging.offen.dev"
|
||||||
export BUCKET="offen-dev-staging"
|
export BUCKET="offen-dev-staging"
|
||||||
export DISTRIBUTION="E13I20LK8ASYFH"
|
export DISTRIBUTION="E13I20LK8ASYFH"
|
||||||
export ROBOTS_FILE="robots.txt.staging"
|
export ROBOTS_FILE="robots.txt.staging"
|
||||||
export OFFEN_ACCOUNT_ID="8f7ee44a-4cd8-47f2-a77e-8c7c98d46b89"
|
export OFFEN_ACCOUNT_ID="8f7ee44a-4cd8-47f2-a77e-8c7c98d46b89"
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
make build
|
- run:
|
||||||
|
name: Build
|
||||||
|
command: make build
|
||||||
|
- run:
|
||||||
|
name: Deploy to S3
|
||||||
|
command: |
|
||||||
aws s3 sync --delete ./output/. s3://$BUCKET
|
aws s3 sync --delete ./output/. s3://$BUCKET
|
||||||
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION --paths "/*"
|
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION --paths "/*"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user