-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bd/21-user-authentication
- Loading branch information
Showing
10 changed files
with
247 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
5 changes: 5 additions & 0 deletions
5
themes/goodbids-nonprofit/patterns/template-home-nonprofit.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"} /--> |