Skip to content

Generate WordPress Archive

Actions
Generates a zip archive of a WordPress project using WP-CLI
1.3.0
Latest
Star (8)

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.

Generate WordPress Archive is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Generates a zip archive of a WordPress project using WP-CLI
1.3.0
Latest

Generate WordPress Archive is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.