Merge pull request #2262 from vektor-inc/develop #105
Workflow file for this run
This file contains 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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Deploy to VWS | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+.[0-9]+" | |
env: | |
plugin_name: vk-blocks-pro | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# [ Start ] pre_ リリース と 本リリースで同じ処理 ########################################## | |
- uses: actions/checkout@v2 | |
# setup node based on the version from the .node-version file, fetched in the previous step | |
- name: Setup Node.js (.node-version) | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.x | |
- name: Install NPM Scripts | |
run: npm install | |
# ビルドで翻訳処理があるため wp-env が必要 | |
- name: Setup PHP 7.4 | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.4 | |
- name: Install Composer Package | |
run: composer install | |
- name: Install @wordpress/env | |
run: npm install -g @wordpress/env | |
- name: Run @wordpress/env | |
run: wp-env start | |
- name: Install WP-CLI | |
run: | | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
chmod +x wp-cli.phar | |
mv wp-cli.phar /usr/local/bin/wp | |
- name: Make Distribution | |
# npm run dist の中で npm run build して composer install --no-dev した上で dist して ( compose install しなおして ) いる | |
# build 漏れの状態で dist してしまう事がないように dist の中に build を含めている | |
run: | | |
npm run dist | |
cd dist/ && zip -r ${{ env.plugin_name }}.zip ${{ env.plugin_name }}/ && mv ${{ env.plugin_name }}.zip ${GITHUB_WORKSPACE} | |
- run : test -e ${{ env.plugin_name }}.zip | |
# [ End ] pre_ リリース と 本リリースで同じ処理 ########################################## | |
- name: rsync deployments | |
uses: burnett01/rsync-deployments@5.2.1 | |
with: | |
switches: -avzr | |
path: ${{ env.plugin_name }}.zip | |
remote_path: ${{ secrets.DEPLOY_PATH_VWS }} | |
remote_host: ${{ secrets.DEPLOY_HOST_VWS }} | |
remote_port: ${{ secrets.DEPLOY_PORT_VWS }} | |
remote_user: ${{ secrets.DEPLOY_USER_VWS }} | |
remote_key: ${{ secrets.DEPLOY_KEY_VWS }} | |
remote_key_pass: ${{ secrets.DEPLOY_KEYPASS_VWS }} |