Automate your workflow
latest
stages: - 📦️ build - 🚀 publish variables: GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_FORCE_HTTPS: "true" PLUGIN_SLUG: dummy WPC_CLI_VERSION: 1.1 WPC_API_KEY: 00000000-0000-0000-0000-000000000000 ⛏️ generate zip: stage: 📦️ build image: wpcontent/wpc-cli:${WPC_CLI_VERSION} script: - composer install --no-dev --optimize-autoloader - wpc plugin:build --slug=${PLUGIN_SLUG} --output-dir=./ . artifacts: paths: - ./${PLUGIN_SLUG}.zip 🗂️ push to registry: stage: 🚀 publish image: wpcontent/wpc-cli:${WPC_CLI_VERSION} script: - wpc plugin:push -m "${CI_COMMIT_MESSAGE}" ./${PLUGIN_SLUG}.zip when: manual workflow: rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
FROM php:8.3-alpine COPY --from=wpcontent/wpc-cli:latest /usr/local/bin/wpc /usr/local/bin/wpc # Run any command RUN wpc plugin:build
FROM php:8.2-alpine AS build LABEL Maintainer="Happy Monkey <support@mkey.fr>" # Prepare system RUN apk update && apk add --no-cache \ gettext \ git \ zip \ libzip-dev \ curl \ sudo \ unzip \ icu-dev \ bzip2-dev \ libpng-dev \ libjpeg-turbo-dev \ freetype-dev \ postgresql-dev \ g++ \ make \ autoconf # Install PHP extensions RUN docker-php-ext-install \ pdo_mysql \ pdo_pgsql \ bcmath \ bz2 \ gd \ intl \ zip # Clean up RUN rm -rf /var/cache/apk/* # Install PHP modules RUN docker-php-ext-configure gd --with-freetype=/usr --with-jpeg=/usr && \ docker-php-ext-install \ bz2 \ zip \ gd \ intl \ bcmath \ opcache \ calendar \ pdo_mysql \ mysqli \ pdo_pgsql \ pgsql # Install Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Add main command COPY ./wpc.phar /usr/local/bin/wpc RUN chmod +x /usr/local/bin/wpc WORKDIR /app