-
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
1 parent
ab1921b
commit 1413353
Showing
4 changed files
with
105 additions
and
3 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,41 @@ | ||
name: Rename the project from template | ||
|
||
on: [push] | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
rename-project: | ||
if: ${{ !contains (github.repository, '/crud-the-docs-playground') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# by default, it uses a depth of 1 | ||
# this fetches all history so that we can read each commit | ||
fetch-depth: 0 | ||
ref: ${{ github.head_ref }} | ||
|
||
- run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- run: echo "REPOSITORY_URLNAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- run: echo "REPOSITORY_OWNER=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}')" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Is this still a template | ||
id: is_template | ||
run: echo "::set-output name=is_template::$(ls .github/template.yml &> /dev/null && echo true || echo false)" | ||
|
||
- name: Rename the project | ||
if: steps.is_template.outputs.is_template == 'true' | ||
run: | | ||
echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URLNAME }}" | ||
.github/rename_project.sh -a ${{ env.REPOSITORY_OWNER }} -n ${{ env.REPOSITORY_NAME }} -u ${{ env.REPOSITORY_URLNAME }} -d "CRUD the ${{ env.REPOSITORY_NAME }} in Playground." | ||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "✅ Ready to CRUD the ${{ env.REPOSITORY_NAME }} in Playground." | ||
push_options: --force |
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,61 @@ | ||
# CRUD the `project_name` with Playground | ||
|
||
https://github.com/author_name/gatherpress-demo-data/assets/198883/79c19cab-24f0-47e8-9710-832aed7938ca | ||
|
||
|
||
# What | ||
|
||
- [Create, read update, delete & save][export-to-github] the demo-data using Playground and persist it with prepared settings for GitHub Export. | ||
- or simply browse & view ... | ||
- [the `docs` with *Twentytwentyfour*](https://playground.wordpress.net/?url=/?p=173&login=yes&import-wxr=https://raw.githubusercontent.com/author_name/project_urlname/main/export.xml). | ||
- [the `docs` with *Disco*](https://playground.wordpress.net/?url=/?p=173&login=yes&import-wxr=https://raw.githubusercontent.com/author_name/project_urlname/main/export.xml&theme=disco). | ||
|
||
## How | ||
|
||
- The `blueprint.json` files is made & validated using the playground-based [blueprint builder][builder] | ||
- Images ... | ||
- Export to xml ... | ||
|
||
### *Settings* | ||
|
||
```json | ||
{ | ||
"step": "setSiteOptions", | ||
"options": { | ||
"blogname": "Books", | ||
"blogdescription": "CRUD the Books in Playground.", | ||
"wordpress_export_to_server__file": "books.xml", | ||
"wordpress_export_to_server__owner_repo_branch": "author_name/example-books/main", | ||
"wordpress_export_to_server__export_home": "https://example.test/books" | ||
} | ||
} | ||
``` | ||
|
||
# Why | ||
|
||
> Idea for the [WCEU Contributor day](https://gatherpress.org/event/hybrid-event-wceu2024-contributor-day/): | ||
> | ||
> Create a demo of your special use case with GatherPress & Playground! | ||
> And let's grow a collection like the blueprint-galleries. | ||
> | ||
> https://gatherpress.slack.com/archives/CNZS6PPFZ/p1717928500570539 | ||
## Based on & wouldn't work without | ||
|
||
- the Export to GitHub feature of WordPress Playground | ||
- and a small, custom plugin, that saves a regular export.xml to the file system, instead of downloading it to the user. | ||
|
||
## Inspired by | ||
|
||
- [adamziel/playground-docs-workflow: Experimenting with maintaining WordPress docs using WordPress Playground](https://github.com/adamziel/playground-docs-workflow) | ||
- and [bgrgicak/playground-blog: A built using WordPress Playground](https://github.com/bgrgicak/playground-blog) | ||
|
||
## Ressources | ||
|
||
- [How to add demo content in WordPress](https://learn.wordpress.org/lesson-plan/how-to-add-demo-content-in-wordpress/) - Learn WordPress | ||
|
||
|
||
[builder]: https://playground.wordpress.net/builder/builder.html?blueprint-url=https://raw.githubusercontent.com/author_name/project_urlname/main/blueprints/blueprint.json | ||
|
||
|
||
[export-to-github]: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/author_name/project_urlname/main/blueprints/blueprint.json&gh-ensure-auth=yes&ghexport-repo-url=https://github.com/author_name/project_urlname&ghexport-pr-action=create&ghexport-playground-root=/wordpress/wp-content/project_urlname-main&ghexport-repo-root=/&ghexport-path=.&ghexport-content-type=custom-paths&ghexport-commit-message=Changes%20from%20Playground&ghexport-allow-include-zip=no |
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