Skip to content

Commit

Permalink
Merge branch 'main' into bd/21-user-authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
bd-viget committed Dec 12, 2023
2 parents 45827da + bb4c963 commit a13ea79
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI

on:
push:
branches: [main, production]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
to-do:
runs-on: ubuntu-latest
steps:
- run: echo "CI goes here"
38 changes: 38 additions & 0 deletions .github/workflows/develop-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Develop Deploy

on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.CI_DEPLOY_KEY }}
name: id_goodbids
known_hosts: unnecessary # Actions have have github.com in known_hosts by default
config: |
Host github.com
HostName github.com
IdentityFile /home/runner/.ssh/id_goodbids
if_key_exists: fail

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Push to remote
run: |
git config --unset-all http.https://github.com/.extraheader
git config user.name "GitHub Actions"
git config user.email [email protected]
git remote add wpvip [email protected]:wpcomvip/goodbids.git
git push -f wpvip main:develop
39 changes: 39 additions & 0 deletions .github/workflows/production-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Production Deploy

on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [production]

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.CI_DEPLOY_KEY }}
name: id_goodbidsNode
known_hosts: unnecessary # Actions have have github.com in known_hosts by default
config: |
Host github.com
HostName github.com
IdentityFile /home/runner/.ssh/id_goodbidsNode
if_key_exists: fail

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: production

- name: Push to remote
run: |
git config --unset-all http.https://github.com/.extraheader
git config user.name "GitHub Actions"
git config user.email [email protected]
git remote add wpvip [email protected]:wpcomvip/goodbids.git
git push -f wpvip production:production
2 changes: 1 addition & 1 deletion client-mu-plugins/goodbids/src/classes/plugins/ACF.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private function disable_admin() : void {

/**
* Save ACF JSON to the plugin directory, but only when developing locally.
* We don't want to break this feature if the non-profit is using ACF.
* We don't want to break this feature if the nonprofit is using ACF.
*
* @since 1.0.0
*
Expand Down
12 changes: 10 additions & 2 deletions themes/goodbids-nonprofit/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
*
* @package GoodBids_Nonprofit
*
* @since 1.0
* @since 1.0.0
*/

require_once get_stylesheet_directory() . '/inc/assets.php';
/**
* Load Theme Assets
*/
require_once get_stylesheet_directory() . '/inc/assets.php';

/**
* Load Theme Patterns
*/
require_once get_stylesheet_directory() . '/inc/patterns.php';
88 changes: 88 additions & 0 deletions themes/goodbids-nonprofit/inc/patterns.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php
/**
* Patterns Functions
*
* @package GoodBids_Nonprofit
*
* @since 1.0.0
*/

/**
* Register Component Pattern Category
*
* @since 1.0.0
*/
add_action(
'init',
function () {
register_block_pattern_category(
'goodbids-np',
[
'label' => __( 'GoodBids Nonprofit', 'goodbids-nonprofit' ),
]
);
}
);

/**
* Register Patterns
*
* @since 1.0.0
*/
add_action(
'init',
function () {
$patterns = [
[
'name' => 'template-home-nonprofit',
'file' => 'patterns/template-home-nonprofit.php',
'title' => __( 'GoodBids Home Template', 'goodbids-nonprofit' ),
'description' => _x( 'Template for the Nonprofit Homepage', 'Block pattern description', 'goodbids-nonprofit' ),
'categories' => [ 'featured', 'goodbids-np' ],
'keywords' => [ 'home', 'non-profit', 'template', 'page' ],
'templateTypes' => [ 'front-page', 'home', 'page' ],
'source' => 'theme',
],
[
'name' => 'about-nonprofit',
'file' => 'patterns/about-nonprofit.php',
'title' => __( 'About GoodBids', 'goodbids-nonprofit' ),
'description' => _x( 'Template for About Page', 'Block pattern description', 'goodbids-nonprofit' ),
'categories' => [ 'about','page', 'goodbids-np' ],
'keywords' => [ 'non-profit', 'starter', 'page' ],
'blockTypes' => [ 'core/post-content', 'core/group', 'core/paragraph' ],
'postTypes' => [ 'page', 'wp_template' ],
'templateTypes' => [ 'front-page', 'home', 'page' ],
'source' => 'theme',
],
];

foreach ( $patterns as $pattern ) {
if ( ! file_exists( get_stylesheet_directory() . '/' . $pattern['file'] ) ) {
continue;
}

$file = $pattern['file'];
$name = $pattern['name'];
$path = get_stylesheet_directory() . '/' . $file;
$extension = pathinfo( $path, PATHINFO_EXTENSION );

unset( $pattern['file'], $pattern['name'] );

if ( 'php' === $extension ) {
ob_start();
include $path;
$content = ob_get_clean();
} else {
$content = wpcom_vip_file_get_contents( $path );
}

$pattern['content'] = $content;

register_block_pattern(
'goodbids-np/' . $name,
$pattern
);
}
}
);
45 changes: 45 additions & 0 deletions themes/goodbids-nonprofit/patterns/about-nonprofit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group"><!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:spacer {"height":"var:preset|spacing|50"} -->
<div style="height:var(--wp--preset--spacing--50)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:post-title {"textAlign":"center","level":1} /-->

<!-- wp:spacer {"height":"var:preset|spacing|30","style":{"spacing":{"margin":{"top":"0","bottom":"0"}}}} -->
<div style="margin-top:0;margin-bottom:0;height:var(--wp--preset--spacing--30)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:post-featured-image {"height":"400px","style":{"spacing":{"margin":{"bottom":"var:preset|spacing|40"}}}} /--></div>
<!-- /wp:group --></main>
<!-- /wp:group -->

<!-- wp:paragraph -->
<p><?php echo esc_html_x( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Nunc id cursus metus aliquam eleifend mi in nulla posuere. Morbi tempus iaculis urna id volutpat lacus. Duis ut diam quam nulla porttitor massa id neque. Ac turpis egestas maecenas pharetra convallis posuere. Nulla posuere sollicitudin aliquam ultrices sagittis. Amet mauris commodo quis imperdiet massa. Odio aenean sed adipiscing diam donec adipiscing. Ultricies integer quis auctor elit sed. Massa sed elementum tempus egestas sed sed risus pretium quam. Eget sit amet tellus cras adipiscing. Sagittis vitae et leo duis ut diam quam nulla porttitor. Id semper risus in hendrerit gravida rutrum. Lorem mollis aliquam ut porttitor leo a. Elementum nibh tellus molestie nunc non blandit massa. Eu facilisis sed odio morbi quis commodo odio.', 'About details block', 'goodbids-nonprofit' ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"},"margin":{"top":"0","bottom":"0"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)"><!-- wp:group {"align":"wide","style":{"border":{"radius":"16px"},"spacing":{"padding":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"backgroundColor":"contrast","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignwide has-contrast-background-color has-background" style="border-radius:16px;padding-top:var(--wp--preset--spacing--40);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--50)"><!-- wp:spacer {"height":"var:preset|spacing|10"} -->
<div style="height:var(--wp--preset--spacing--10)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading {"textAlign":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|base"}}}},"textColor":"base","fontSize":"x-large"} -->
<h2 class="wp-block-heading has-text-align-center has-base-color has-text-color has-link-color has-x-large-font-size"><?php esc_html_e( 'Join 900+ subscribers', 'goodbids-nonprofit' ); ?></h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|base"}}}},"textColor":"base"} -->
<p class="has-text-align-center has-base-color has-text-color has-link-color"><?php esc_html_e( 'Stay in the loop with everything you need to know.', 'goodbids-nonprofit' ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"contrast-4","textColor":"contrast","style":{"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"className":"is-style-fill"} -->
<div class="wp-block-button is-style-fill"><a class="wp-block-button__link has-contrast-color has-contrast-4-background-color has-text-color has-background has-link-color wp-element-button"><?php esc_html_e( 'Sign up', 'goodbids-nonprofit' ); ?></a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:spacer {"height":"var:preset|spacing|10"} -->
<div style="height:var(--wp--preset--spacing--10)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- wp:group {"tagName":"main","style":{"spacing":{"blockGap":"0","margin":{"top":"0"}}},"layout":{"type":"default"}} -->
<main class="wp-block-group" style="margin-top:0">
<!-- wp:pattern {"slug":"twentytwentyfour/page-home-business"} /-->
</main>
<!-- /wp:group -->
4 changes: 2 additions & 2 deletions themes/goodbids-nonprofit/style.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Theme Name: GoodBids Non-profit
Theme Name: GoodBids Nonprofit
Theme URI: https://goodbids.org
Author: Viget
Author URI: https://viget.com
Description: Twenty Twenty-Four child theme for GoodBids Charity sites.
Description: Twenty Twenty-Four child theme for GoodBids Nonprofit sites.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down
3 changes: 3 additions & 0 deletions themes/goodbids-nonprofit/templates/front-page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->
<!-- wp:pattern {"slug":"goodbids-nonprofit/template-home-nonprofit"} /-->
<!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer"} /-->

0 comments on commit a13ea79

Please sign in to comment.