Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds about page; integrates USWDS; adds RSS icon #433

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .circleci/cleanup.sh

This file was deleted.

139 changes: 47 additions & 92 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,118 +1,73 @@
version: 2.1

orbs:
node: circleci/node@5.2.0
node: circleci/node@6.3.0

jobs:
preview:
executors:
blog-executor:
docker:
- image: cimg/base:stable
resource_class: xlarge
environment:
TEST_REPORTS: /tmp/test-reports
steps:
- checkout
- node/install:
node-version: '12.13.0'
- node/install-packages
- run:
name: Build gatsby
command: npm run build
- run:
name: deploy preview to cloud.gov
command: |
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
sudo apt-get update
sudo apt-get install cf8-cli
cf api https://api.fr.cloud.gov
cf auth "$CF_USERNAME" "$CF_PASSWORD"
cf target -o doi-onrr -s dev -v
cf push dev-blog-nrrd -f ./manifest.yml


dev:
docker:
- image: cimg/base:stable
resource_class: xlarge
steps:
- checkout
- node/install:
node-version: '12.13.0'
- node/install-packages
- run:
name: Build gatsby
command: npm run build
- run:
name: deploy to cloud.gov
command: |
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
sudo apt-get update
sudo apt-get install cf8-cli
cf api https://api.fr.cloud.gov
cf auth "$CF_USERNAME" "$CF_PASSWORD"
cf target -o doi-onrr -s dev -v
cf push dev-blog-nrrd -f ./manifest.yml
- run:
name: clean up
command: |
which cf
bash ./.circleci/cleanup.sh

deploy:
docker:
- image: cimg/base:stable
steps:
- checkout
- node/install:
node-version: '12.13.0'
- node/install-packages
- run:
name: Build gatsby
command: npm run build
- run:
name: deploy preview to cloud.gov
command: |
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
sudo apt-get update
sudo apt-get install cf8-cli
cf api https://api.fr.cloud.gov
cf auth "$CF_USERNAME" "$CF_PASSWORD"
cf target -o doi-onrr -s prod
cf push blog-nrrd -f ./manifest.yml


workflows:
preview:
deploy-prod-workflow:
jobs:
- preview:
context:
- org-global
- DEV
- build:
filters:
branches:
ignore:
- master
- dev

deploy:
jobs:
only: master
- deploy:
requires:
- build
context:
- org-global
- PROD
filters:
branches:
only: master

dev:
deploy-dev-workflow:
jobs:
- dev:
- build:
filters:
branches:
ignore: master
- deploy:
requires:
- build
context:
- org-global
- DEV
filters:
branches:
only: dev
ignore: master

jobs:
build:
executor: blog-executor
steps:
- checkout
- node/install:
node-version: '18.20.4'
- node/install-packages
- run:
name: Build gatsby
command: npm run build
- persist_to_workspace:
root: ~/project
paths:
- .
deploy:
executor: blog-executor
steps:
- attach_workspace:
at: ~/project
- run:
name: Rename partytown directory
command: |
mv ~/project/public/~partytown ~/project/public/_partytown
- run:
name: Deploy to cloud.gov
command: |
chmod +x ~/project/.circleci/scripts/deploy.sh
~/project/.circleci/scripts/deploy.sh --branch "$CIRCLE_BRANCH"
27 changes: 0 additions & 27 deletions .circleci/junit.xml

This file was deleted.

115 changes: 0 additions & 115 deletions .circleci/preview.sh

This file was deleted.

60 changes: 60 additions & 0 deletions .circleci/scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

TEMP=$(getopt -o '' --long branch: -- "$@")
if [ $? != 0 ]; then
echo "Terminating..." >&2
exit 1
fi

eval set -- "$TEMP"

branch=""
manifest=""
space=""

while true; do
case "$1" in
--branch)
branch=$2; shift 2 ;;
--)
shift; break ;;
*)
echo "Internal error!" >&2
exit 1 ;;
esac
done

if [ -z "$branch" ]; then
echo "Error: --branch is required." >&2
exit 1
fi

if [ "$branch" == "master" ]; then
space="prod"
manifest="manifest.master.yml"
else
space="dev"
manifest="manifest.dev.yml"
fi

wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -

echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list

sudo apt-get update

sudo apt-get install cf8-cli

cf login -u "$CF_USERNAME" -p "$CF_PASSWORD" -a api.fr.cloud.gov -o "$CF_ORG" -s "$space"

cf push --strategy=rolling -f "$manifest"

exit_code=$?

if [ $exit_code -ne 0 ]; then
echo "Error: cf push failed with exit code $exit_code"
exit $exit_code
else
echo "manifest $manifest successfully deployed."
exit 0
fi
Loading
Loading