Skip to content

Commit

Permalink
Updated github actions and gitpod (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Jul 15, 2024
1 parent 33c2ca6 commit 202a0e5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 43 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/build_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
image: pookmish/drupal8ci:latest
env:
BUILD_PAGES: 100
SITENAME: sitedir
services:
mysql:
image: mysql:5.7
Expand All @@ -45,13 +46,6 @@ jobs:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
# - name: Install SSH key
# uses: shimataro/ssh-key-action@v2
# with:
# key: ${{ secrets.SSH_KEY }}
# name: id_rsa
# known_hosts: ${{ secrets.KNOWN_HOSTS }}
# if_key_exists: fail
- uses: actions/checkout@v4
with:
repository: "SU-SWS/ace-stanfordlagunita"
Expand Down Expand Up @@ -80,11 +74,10 @@ jobs:
ln -snf $GITHUB_WORKSPACE /var/www/html &&
mkdir -p docroot/sites/default/files &&
chmod -R 777 docroot/sites/default/files/ &&
rm -rf docroot/sites/summer/files &&
ln -sL ../default/files/ docroot/sites/summer/files &&
apachectl stop && apachectl start &&
composer install -n &&
blt drupal:install -n
blt drupal:install -n &&
drush sqlq 'truncate config_pages__su_site_algolia_id'
- name: Build Frontend
run: |
cd $GITHUB_WORKSPACE/frontend &&
Expand Down
54 changes: 26 additions & 28 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

additionalRepositories:
- url: https://github.com/SU-SWS/acsf-cardinalsites-public
- url: https://github.com/SU-SWS/ace-stanfordlagunita/
checkoutLocation: back
checkoutLocation: front
ports:
Expand All @@ -19,7 +19,7 @@ ports:
visibility: public
- name: frontend
description: NextJS frontend
port: 3000
port: 3000-3004
onOpen: ignore
visibility: public
- port: 8002-9999
Expand All @@ -28,46 +28,47 @@ image: pookmish/drupal8ci:gitpod
tasks:
- name: Drupal Prep
init: >
eval $(gp env -e SITENAME=default) &&
eval $(gp env -e APACHE_DOCROOT_IN_REPO=../back/docroot) &&
cd /workspace/back &&
rm -rf config/default &&
mkdir -p config/default &&
touch config/default/core.extension.yml &&
git checkout 2.x &&
composer install --no-interaction &&
mkdir -p blt &&
cp .gitpod/blt.yml blt/local.blt.yml &&
find docroot/sites/ -name 'local*' | xargs rm -rf &&
cp .gitpod/global.settings.php docroot/sites/settings/global.settings.php &&
cp .gitpod/default.local.services.yml docroot/sites/local.services.yml &&
export NEXT_PUBLIC_DRUPAL_BASE_URL=`gp url 8001` &&
export PREVIEW_URL=${NEXT_PUBLIC_DRUPAL_BASE_URL#"https://"} &&
blt blt:telemetry:disable --no-interaction &&
blt settings &&
blt drupal:install -n &&
drush cset system.theme default claro -y &&
echo 'ssh: {options: "-o StrictHostKeyChecking=no"}' > drush/local.drush.yml &&
if [[ ! -z $SSH_PRIVATE_KEY ]]; then
echo $SSH_PRIVATE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa &&
blt drupal:sync --site=$SITENAME -n || blt drupal:install --site=$SITENAME -n
else
blt drupal:install --site=$SITENAME -n
fi &&
drush @$SITENAME.local cset system.theme default stanford_profile_admin_theme -y &&
cd /workspace/front &&
yarn
command: |
cp .env.example .env.local &&
cd /workspace/back &&
echo 'Restarting Apache' &&
gp ports await 3306 &&
eval $(gp env -e APACHE_DOCROOT_IN_REPO=../back/docroot) &&
apache2ctl restart &&
gp ports await 8001 &&
find docroot -name 'local.drush.yml' | xargs rm &&
cd /workspace/back &&
export NEXT_PUBLIC_DRUPAL_BASE_URL=`gp url 8001` &&
export PREVIEW_URL=${NEXT_PUBLIC_DRUPAL_BASE_URL#"https://"} &&
blt blt:telemetry:disable --no-interaction &&
echo 'Establishing Settings' &&
echo "<?php \$sites['$PREVIEW_URL'] = '$SITENAME';" > docroot/sites/local.sites.php &&
blt settings &&
echo 'Logging Into Drupal' &&
drush uli --uri=$NEXT_PUBLIC_DRUPAL_BASE_URL &&
drush uli --uri=$NEXT_PUBLIC_DRUPAL_BASE_URL | xargs gp preview --external &&
apache2ctl restart &&
gp ports await 8001 &&
drush @$SITENAME.local uli --uri=$NEXT_PUBLIC_DRUPAL_BASE_URL &&
drush @$SITENAME.local uli --uri=$NEXT_PUBLIC_DRUPAL_BASE_URL | xargs gp preview --external &&
git config core.fileMode false &&
echo 'Connecting Drupal to Frontend' &&
drush su-next-connect "$(gp url 3000)" >> /workspace/front/.env.local &&
drush @$SITENAME.local su-next-connect "$(gp url 3000)" >> /workspace/front/.env.local &&
cd /workspace/front &&
yarn &&
yarn install &&
yarn config set --home enableTelemetry 0 &&
yarn next telemetry disable &&
sed -i -r "s|NEXT_PUBLIC_DRUPAL_BASE_URL.*|NEXT_PUBLIC_DRUPAL_BASE_URL=$NEXT_PUBLIC_DRUPAL_BASE_URL|g" .env.local &&
yarn dev &
gp ports await 3000 &&
Expand All @@ -76,17 +77,14 @@ tasks:
before: |
code --add /workspace/back &&
mkdir -p ~/.ssh
if [[ ! -z $SSH_PUBLIC_KEY ]]; then
echo $SSH_PUBLIC_KEY | base64 -d > ~/.ssh/id_rsa.pub && chmod 644 ~/.ssh/id_rsa.pub
git remote set-url origin $(echo $GITPOD_WORKSPACE_CONTEXT | jq -r .repository.cloneUrl | sed -E 's|^.*.com/(.*)$|[email protected]:\1|')
fi
if [[ ! -z $SSH_PRIVATE_KEY ]]; then
echo $SSH_PRIVATE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
echo $SSH_PRIVATE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa &&
git remote set-url origin $(echo $GITPOD_WORKSPACE_CONTEXT | jq -r .repository.cloneUrl | sed -E 's|^.*.com/(.*)$|[email protected]:\1|') &&
cd /workspace/back && git remote set-url origin [email protected]:SU-SWS/ace-stanfordlagunita.git
fi
if [[ ! -z $GITCONFIG ]]; then
echo $GITCONFIG | base64 -d > ~/.gitconfig && chmod 644 ~/.gitconfig
fi
git remote set-url origin $(echo $GITPOD_WORKSPACE_CONTEXT | jq -r .repository.cloneUrl | sed -E 's|^.*.com/(.*)$|[email protected]:\1|')
vscode:
extensions:
Expand Down
8 changes: 4 additions & 4 deletions src/components/elements/headers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ const headingLinkClasses = "[&_a]:text-digital-red [&_a]:hocus:text-black [&_a]:

export const H1 = ({children, className, ...props}: Props) => {
return (
<h1 className={twMerge(className, "type-5")} {...props}>
<h1 className={twMerge(className, "type-6")} {...props}>
{children}
</h1>
)
}

export const H2 = ({children, className, ...props}: Props) => {
return (
<h2 className={twMerge(headingLinkClasses, "type-4", className)} {...props}>
<h2 className={twMerge(headingLinkClasses, "type-3", className)} {...props}>
{children}
</h2>
)
}

export const H3 = ({children, className, ...props}: Props) => {
return (
<h3 className={twMerge(headingLinkClasses, "type-3", className)} {...props}>
<h3 className={twMerge(headingLinkClasses, "type-2", className)} {...props}>
{children}
</h3>
)
}

export const H4 = ({children, className, ...props}: Props) => {
return (
<h4 className={twMerge(headingLinkClasses, "type-2", className)} {...props}>
<h4 className={twMerge(headingLinkClasses, "type-1", className)} {...props}>
{children}
</h4>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const BannerParagraph = ({paragraph, eagerLoadImage, ...props}: Props) => {
{paragraph.suBannerHeader && (
<>
{headerTag === "h2" && (
<H2 id={paragraph.id} className={twMerge(headerClasses, "mb-0")}>
<H2 id={paragraph.id} className={twMerge(headerClasses, "type-2 mb-0")}>
{paragraph.suBannerHeader}
</H2>
)}
Expand Down

0 comments on commit 202a0e5

Please sign in to comment.