Merge pull request #939 from WordPress/dependabot/npm_and_yarn/fast-u… #209
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| branches: | |
| # For readme and asset updates. | |
| - master | |
| # Disable permissions for all available scopes by default. | |
| # Any needed permissions should be configured at the job level. | |
| permissions: {} | |
| jobs: | |
| deploy: | |
| name: Deploy to WordPress.org | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write # Required to upload assets to the GitHub release. | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 | |
| with: | |
| cache: 'npm' | |
| node-version-file: '.nvmrc' | |
| - name: Setup PHP and Composer | |
| uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0 | |
| with: | |
| php-version: '5.6' | |
| tools: composer:v2 | |
| - name: Install NPM dependencies | |
| run: npm install | |
| - name: Build plugin | |
| run: npm run build | |
| - name: WordPress.org asset and readme update | |
| uses: 10up/action-wordpress-plugin-asset-update@2480306f6f693672726d08b5917ea114cb2825f7 # v2.2.0 | |
| if: github.ref_name == 'trunk' | |
| env: | |
| # Note: this action doesn't support BUILD_DIR so it pushes the raw readme.txt | |
| IGNORE_OTHER_FILES: true | |
| SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
| SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
| - name: WordPress.org deploy | |
| id: deploy | |
| uses: 10up/action-wordpress-plugin-deploy@54bd289b8525fd23a5c365ec369185f2966529c2 # v2.3.0 | |
| if: startsWith( github.ref, 'refs/tags/' ) | |
| with: | |
| generate-zip: true | |
| env: | |
| BUILD_DIR: dist | |
| SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
| SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1 | |
| if: startsWith( github.ref, 'refs/tags/' ) | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: ${{ steps.deploy.outputs.zip-path }} | |
| fail_on_unmatched_files: true |