Skip to content

Merge pull request #2257 from vektor-inc/develop #415

Merge pull request #2257 from vektor-inc/develop

Merge pull request #2257 from vektor-inc/develop #415

Workflow file for this run

# 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 VK Blocks Free
on:
push:
tags:
- "pre_[0-9]+.[0-9]+.[0-9]+.[0-9]+"
env:
plugin_name: vk-blocks-pro
GIT_REPOSITORY_MAIL: ${{ secrets.GIT_REPOSITORY_MAIL }}
GIT_REPOSITORY_USER: ${{ secrets.GIT_REPOSITORY_USER }}
GIT_REPOSITORY_FREE: ${{ secrets.GIT_REPOSITORY_FREE }}
GIT_USER: ${{ secrets.GIT_USER }}
# 無料版のリポジトリをPro版の中で一旦 clone して、bin/deploy-free.sh で処理する
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# 通常版をクローン Tagのバージョンを取得。
# GITHUB_REFには、refs/tags/0.0.0 が値が入っているので前から10文字を削除して、バージョンのみを取得する。
# https://qiita.com/maruware/items/3da1f5866f6f233a1ad1#%E3%82%BF%E3%82%B0%E5%90%8D%E3%82%92%E5%A4%89%E6%95%B0%E3%81%A8%E3%81%97%E3%81%A6%E4%BD%BF%E7%94%A8
- name: Get tag version
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
# 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
- run: npm install -g npm
# SSH Key の設定
- name: Setup SSH Key
uses: MrSquaare/ssh-setup-action@v3
with:
host: github.com
private-key: ${{ secrets.DEPLOY_KEY_FREE }}
private-key-name: vk-blocks-free
# 通常版を(Pro版の中に)クローン
- run: git clone [email protected]:${GIT_REPOSITORY_USER}/${GIT_REPOSITORY_FREE}.git ./temp/plugins/${GIT_REPOSITORY_FREE}
# VK Blocks の Githubにアクセスできるユーザーの設定
- run: git config --global user.email "${GIT_REPOSITORY_MAIL}"
- run: git config --global user.name "${GIT_USER}"
# # 無料版にデプロイするスクリプトにタグ名を引数で渡す。
- run: bash bin/deploy-free.sh $RELEASE_VERSION