-
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.
- Loading branch information
Showing
23 changed files
with
21,399 additions
and
0 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,70 @@ | ||
name: Deploy to Github Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
bundle: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@main | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@main | ||
|
||
- name: Install Deps and build | ||
run: | | ||
npm ci | ||
npm run build | ||
- name: Upload Assets | ||
uses: actions/upload-artifact@main | ||
with: | ||
name: bundle | ||
path: './build' | ||
|
||
deploy: | ||
needs: bundle | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@main | ||
|
||
- name: Download Plugin | ||
uses: actions/download-artifact@main | ||
with: | ||
name: bundle | ||
path: './build' | ||
|
||
- name: Get version | ||
id: version | ||
run: | | ||
echo "VERSION=$(grep -Po 'Version: \K.*' style.css)" >> "$GITHUB_ENV" | ||
shell: bash | ||
|
||
- name: Zip theme directory | ||
run: zip -r theme.zip . -x '*.git*' -x '.github/**' -x 'composer.json' -x 'composer.lock' -x 'package.json' -x 'package-lock.json' -x 'webpack.config.js' -x 'README.md' -x 'phpcs.xml.dist' | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: v${{env.VERSION}} | ||
release_name: Release ${{env.VERSION}} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
uses: actions/upload-release-asset@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./theme.zip | ||
asset_name: theme.zip | ||
asset_content_type: application/zip |
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,43 @@ | ||
name: PHPCS check | ||
on: | ||
pull_request: | ||
|
||
# Cancel all previous workflow runs for the same branch that have not yet completed. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
phpcs: | ||
name: PHPCS check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: 'shivammathur/setup-php@v2' | ||
with: | ||
php-version: 'latest' | ||
ini-values: memory_limit=256M' | ||
coverage: none | ||
tools: cs2pr | ||
|
||
- name: Install Composer dependencies | ||
uses: 'ramsey/composer-install@v2' | ||
with: | ||
# Bust the cache at least once a month - output format: YYYY-MM. | ||
custom-cache-suffix: $(date -u "+%Y-%m") | ||
|
||
- name: Lint PHP | ||
id: phpcbf | ||
continue-on-error: true | ||
run: composer phpcbf | ||
|
||
- name: Run PHPCS checks | ||
id: phpcs | ||
run: composer phpcs | ||
|
||
- name: Show PHPCS results in PR | ||
if: ${{ always() && steps.phpcs.outcome == 'failure' }} | ||
run: cs2pr ./phpcs-report.xml |
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 @@ | ||
.DS_Store | ||
node_modules | ||
vendor | ||
build | ||
dist |
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 |
---|---|---|
@@ -1,2 +1,32 @@ | ||
# pro-child-template | ||
|
||
A Template repo to help spin up custom child themes for clients quickly. | ||
|
||
## Getting Started | ||
|
||
1. Update the style.css, package.json and composer.json files to use the client's name. | ||
2. Install the packages with `composer update` and `npm i`. | ||
3. Make any tweaks to the code (see below). | ||
4. Update the screenshot.png file. | ||
5. Update or delete this README.md. | ||
|
||
## Configure Pro Theme | ||
|
||
1. Use Pro's "Blank" Stack. | ||
2. Install/Define Fonts. | ||
3. Define Colors. | ||
4. Don't update font sizes! They _should_ be generated with this theme's css. (Exceptions will occur). | ||
5. Any CSS or JS that _would_ be defined in Cornerstone's global code should be defined in this theme. | ||
|
||
## Configuring the Child Theme | ||
|
||
1. Define Colors in `_variables.scss` | ||
2. Define color palette in [`theme.json`](https://developer.wordpress.org/themes/global-settings-and-styles/settings/color/). | ||
3. Write any custom code you need. | ||
4. When you're done, run `npm run build` | ||
|
||
## Uploading to WordPress | ||
|
||
1. Make sure Pro Theme is installed! | ||
2. Download this zip from Github | ||
3. Install to the Site! |
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,29 @@ | ||
{ | ||
"name": "kingdom-one/k1-blocks-child-theme", | ||
"description": "a blocks-based child theme of Pro", | ||
"type": "project", | ||
"repositories": [ | ||
{ | ||
"type": "composer", | ||
"url": "https://wpackagist.org", | ||
"only": [ | ||
"wpackagist-plugin/*", | ||
"wpackagist-theme/*" | ||
] | ||
} | ||
], | ||
"config": { | ||
"allow-plugins": { | ||
"composer/installers": true, | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
}, | ||
"scripts": { | ||
"phpcs": "phpcs . ./inc/ --extensions=php --ignore=*/vendor/*,*/build/* ", | ||
"phpcbf": "phpcbf . ./inc/ --extensions=php --ignore=*/vendor/*,*/build/* " | ||
}, | ||
"require-dev": { | ||
"wp-coding-standards/wpcs": "*", | ||
"php-stubs/acf-pro-stubs": "^6.2" | ||
} | ||
} |
Oops, something went wrong.