name: Deploy Themes to Dotorg on: push: branches: [ trunk, automate/dotorgdeploy ] workflow_dispatch: inputs: preview: description: 'Dry run: report what would be deployed, without writing to SVN' type: boolean default: true env: SECEX_EGRESS_RULES: deb.debian.org,security.debian.org,archive.ubuntu.com,security.ubuntu.com,wordpress.org,themes.svn.wordpress.org permissions: contents: read jobs: deploy: runs-on: [self-hosted, secex, gha-runner-2cpu-2gb] steps: - name: Checkout uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 # The secex image ships neither subversion nor rsync, so both are installed # here. Only what is actually missing gets installed: `apt-get update` is the # slow half and is skipped entirely on a runner that already has both. - name: Install SVN and rsync run: | missing=() command -v svn >/dev/null 2>&1 || missing+=(subversion) command -v rsync >/dev/null 2>&1 || missing+=(rsync) if [ ${#missing[@]} -eq 0 ]; then echo "svn and rsync already present" else echo "Installing: ${missing[*]}" sudo apt-get update sudo apt-get install -y "${missing[@]}" fi # Passing `preview` makes the script report the upgrades it would perform and # stop before any SVN write. The `inputs` context is only populated for # workflow_dispatch, so a push to trunk supplies no argument and deploys for # real; a manual dispatch defaults to the dry run and has to be opted out of. - name: Deploy themes to WordPress.org run: bash .theme-utils/deploy-dotorg.sh ${{ inputs.preview && 'preview' || '' }} env: SVN_USERNAME: ${{ secrets.SVN_USERNAME }} SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}