Skip to content

Commit

Permalink
Prepare via CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
carstingaxion committed May 7, 2024
1 parent 8ee2da8 commit be76b1b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 46 deletions.
30 changes: 11 additions & 19 deletions .github/workflows/prepare-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,32 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repo.
uses: actions/checkout@v4

- name: Clone wporg-parent-2021 parent theme sourcecode.
uses: actions/checkout@v4
with:
repository: 'WordPress/wporg-parent-2021'
path: 'wporg-parent-2021'
path: 'assets/themes/wporg-parent-2021'

- name: Clone wporg-developer-2023 theme sourcecode.
uses: actions/checkout@v4
with:
repository: 'WordPress/wporg-developer'
path: 'wporg-developer-2023'
path: 'assets/themes/wporg-developer-2023'

- name: Clone GatherPress sourcecode.
uses: actions/checkout@v4
with:
repository: 'GatherPress/gatherpress'
path: 'gatherpress'
path: 'assets/plugins/gatherpress'

- name: Clone phpdoc-parser source.
uses: actions/checkout@v4
with:
repository: 'WordPress/phpdoc-parser'
path: 'phpdoc-parser'
path: 'assets/plugins/phpdoc-parser'

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -46,23 +48,13 @@ jobs:
${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --ignore-platform-req=php+ --working-dir "${{ github.workspace }}/phpdoc-parser"
run: composer install --ignore-platform-req=php+ --working-dir "${{ github.workspace }}/assets/plugins/phpdoc-parser"

- name: Copy built assets into ZIP for extraction inside Playground.
run: |
mkdir -p wp-content/vendor
mkdir -p wp-content/plugins/gatherpress
mkdir -p wp-content/plugins/phpdoc-parser
mkdir -p wp-content/themes/wporg-parent-2021
mkdir -p wp-content/themes/wporg-developer-2023
cp -r phpdoc-parser/vendor wp-content/vendor
cp -r gatherpress wp-content/plugins/gatherpress
cp -r phpdoc-parser wp-content/plugins/phpdoc-parser
cp -r wporg-parent-2021/source/wp-content/themes/wporg-parent-2021 wp-content/themes/wporg-parent-2021
cp -r wporg-developer-2023/source/wp-content/themes/wporg-developer-2023 wp-content/themes/wporg-developer-2023
zip -r zips/playground-assets.zip assets -x "*.git*"
rm -rf assets
- name: Create downloadable artifact.
uses: actions/upload-artifact@v4
- uses: EndBug/add-and-commit@v9
with:
name: playground-assets
path: assets
message: 'Persist prepared assets'
30 changes: 3 additions & 27 deletions blueprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,12 @@
"username": "admin",
"password": "password"
},
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "url",
"url": "https://raw.githubusercontent.com/carstingaxion/gatherpress-demo-data/main/gatherpress-0.28.0.zip"
},
"options": {
"activate": false
}
},
{
"step": "installTheme",
"themeZipFile": {
"resource": "url",
"url": "https://raw.githubusercontent.com/carstingaxion/gatherpress-devhub/main/zips/wporg-developer-2023.zip"
},
"options": {
"activate": false
}
},
{
"step": "mkdir",
"path": "/wordpress/assets"
},
{
"step": "writeFile",
"path": "/wordpress/wp-content/assets.zip",
"path": "/wordpress/assets.zip",
"data": {
"resource": "url",
"url": "https://github.com/carstingaxion/gatherpress-devhub/actions/runs/8974176983/artifacts/1477583114",
"url": "https://raw.githubusercontent.com/carstingaxion/gatherpress-devhub/main/zips/playground-assets.zip",
"caption": "Downloading CI/CD prepared assets."
},
"progress": {
Expand All @@ -66,7 +42,7 @@
"step": "unzip",
"zipFile": {
"resource": "vfs",
"path": "/wordpress/wp-content/assets.zip"
"path": "/wordpress/assets.zip"
},
"extractToPath": "/wordpress/wp-content"
},
Expand Down

0 comments on commit be76b1b

Please sign in to comment.