Skip to content

Commit 6c52c21

Browse files
authored
build: 🚚 Update Pantheon repo on plugin release (#88)
* docs: 🎨 Simplify the PR template * build: 🚀 Add deploy to Pantheon to release action
1 parent 683a7ca commit 6c52c21

3 files changed

Lines changed: 60 additions & 22 deletions

File tree

.deployignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.git/
2+
.github/
3+
node_modules/
4+
.gitignore
5+
.deployignore
6+
package.json
7+
package-lock.json
8+
composer.json
9+
composer.lock
10+
webpack.config.js
11+
.eslintrc.js
12+
.phpcs.xml.dist
13+
.stylelintrc.json
14+
tests/
15+
.nvmrc
16+
.editorconfig
17+
webpack.config.js
18+
wp-plugin-version-updater.js
19+
.vscode
20+
*.code-workspace
21+
.gitattributes

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,6 @@
22

33
[ description ]
44

5-
## QA
6-
7-
### Links to relevant issues
8-
9-
- [Link to Issue](https://example.com)
10-
11-
### Links to deployed, scaffolded demo
12-
13-
- [Link to Demo](https://example.com)
14-
15-
### Screenshots/video
16-
17-
- [Link to Video](https://example.com)
18-
195
## Tests
206

21-
### Does this have tests?
22-
23-
- [ ] Yes
24-
- [ ] No, this doesn't need tests because...
25-
- [ ] No, I need help figuring out how to write the tests.
7+
[ instructions and what to expect ]

.github/workflows/release.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ on:
55
tags:
66
- 'v*.*.*'
77
- 'v*.*.*-rc.*'
8-
8+
workflow_dispatch:
9+
910
permissions:
1011
contents: write
1112

1213
jobs:
13-
deploy:
14+
build:
1415
runs-on: ubuntu-latest
1516

1617
steps:
@@ -19,7 +20,10 @@ jobs:
1920
with:
2021
node-version: 20
2122
cache: 'npm'
22-
23+
- uses: webfactory/ssh-agent@v0.8.0
24+
with:
25+
ssh-private-key: ${{ secrets.PANTHEON_SSH_KEY }}
26+
2327
- name: Install Composer dependencies
2428
run: |
2529
composer install --optimize-autoloader --ignore-platform-reqs --no-dev
@@ -38,3 +42,34 @@ jobs:
3842
with:
3943
files: ucsc-custom-functionality.zip
4044
generate_release_notes: true
45+
46+
- name: Create plugin archive
47+
run: |
48+
# Create a clean copy of your plugin
49+
mkdir -p deploy/ucsc-custom-functionality
50+
rsync -av --exclude-from='.deployignore' . deploy/ucsc-custom-functionality/
51+
52+
- name: Clone Pantheon repository
53+
run: |
54+
git clone ssh://codeserver.dev.${{ secrets.PANTHEON_SITE_UUID }}@codeserver.dev.${{ secrets.PANTHEON_SITE_UUID }}.drush.in:2222/~/repository.git pantheon-site
55+
cd pantheon-site
56+
git checkout master # or your target branch
57+
58+
- name: Deploy plugin to Pantheon
59+
run: |
60+
cd pantheon-site
61+
62+
# Remove old plugin version if it exists
63+
rm -rf wp-content/plugins/ucsc-custom-functionality
64+
65+
# Copy new plugin version
66+
cp -r ../deploy/ucsc-custom-functionality wp-content/plugins/
67+
68+
# Configure git
69+
git config user.email "action@github.com"
70+
git config user.name "GitHub Action"
71+
72+
# Commit and push changes
73+
git add .
74+
git commit -m "Deploy plugin ucsc-custom-functionality-${{ github.event.release.tag_name || github.sha }}" || exit 0
75+
git push origin master

0 commit comments

Comments
 (0)