Skip to content

Commit

Permalink
adding GitHub actions for first deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
2ndkauboy committed May 14, 2022
1 parent 63b1700 commit b5f2c1e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/wordpress-plugin-asset-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Plugin asset/readme update
on:
push:
branches:
- stable
jobs:
stable:
name: Push to trunk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: WordPress.org plugin asset/readme update
uses: 10up/action-wordpress-plugin-asset-update@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
README_NAME: README.md
42 changes: 42 additions & 0 deletions .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy to WordPress.org
on:
release:
types: [published]

jobs:
tag:
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Composer install
uses: shivammathur/setup-php@v2
with:
php-version: 5.6
- run: composer install --no-dev --ignore-platform-reqs --optimize-autoloader

- name: Assets build
run: |
npm install
npm run build
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.deploy.outputs.zip-path }}
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip

0 comments on commit b5f2c1e

Please sign in to comment.