Skip to content

Build a zip archive of your WordPress plugin & theme using GitHub Actions

License

Notifications You must be signed in to change notification settings

rudlinkon/action-wordpress-build-zip

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WordPress Build Zip GitHub Action

This GitHub Action automates the process of generating a zip archive of a WordPress project using WP-CLI and uploads it as an artifact.

3EOpSG.mp4

Usage

To use this action, you will want to copy the contents of one of these examples into .github/workflows/build-archive.yml and push that to your repository. You are welcome to name the file something else, but it must be in that directory. The usage of ubuntu-latest is recommended for compatibility with required dependencies in this Action. Here's an example workflow:

Build zip on demand and keep that for 1 day with installation of composer dependencies and npm build with specific node version

name: Generate WordPress Archive
on:
  workflow_dispatch

jobs:
  generate-archive:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Generating zip
        uses: rudlinkon/action-wordpress-build-zip@master
        with:
          retention-days: 1 # Optional; defaults to 3
          install-composer: true # Optional; defaults to false
          npm-run-build: true # Optional; defaults to false
          node-version: 20 # Optional; defaults to 16

Build zip on pushes to master

name: Generate WordPress Archive

on:
  push:
    branches:
      - master

jobs:
  generate-archive:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Generating zip
        uses: rudlinkon/action-wordpress-build-zip@master

This workflow will execute the WordPress Build Zip action on each push to the master branch of your repository.

Build zip on pushes to any branch

name: Generate WordPress Archive
on:
  push

jobs:
  generate-archive:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Generating zip
        uses: rudlinkon/action-wordpress-build-zip@master

This workflow will execute the WordPress Build Zip action on each push to your repository.

Build zip on demand

name: Generate WordPress Archive
on:
  workflow_dispatch

jobs:
  generate-archive:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Generating zip
        uses: rudlinkon/action-wordpress-build-zip@master

Build zip on demand and keep that for 1 day

name: Generate WordPress Archive
on:
  workflow_dispatch

jobs:
  generate-archive:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Generating zip
        uses: rudlinkon/action-wordpress-build-zip@master
        with:
          retention-days: 1 # Optional; defaults to 3

Input Options

Name Type Default Usage
retention-days int 3 Configuring a custom artifact retention period
node-version int 16 Set you custom node version
install-composer bool false Composer dependencies will be installed if you enable this option
npm-run-build bool false npm run build will be run if you enable this option

License

This action is licensed under the MIT License.

About

Build a zip archive of your WordPress plugin & theme using GitHub Actions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages