Merge pull request #1882 from vektor-inc/develop #370
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 VK Blocks Free | |
on: | |
push: | |
tags: | |
- "pre_[0-9]+.[0-9]+.[0-9]+.[0-9]+" | |
env: | |
plugin_name: vk-blocks-pro | |
GIT_TOKEN: ${{ secrets.ACCESSTOKEN_FOR_VK_BLOCKS_FREE }} | |
GIT_USER: ${{ secrets.GIT_USER }} | |
GIT_REPOSITORY: ${{ secrets.GIT_REPOSITORY }} | |
# 無料版のリポジトリを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 | |
# get the node version from the .node-version file | |
- name: Read .node-version | |
run: echo "##[set-output name=NODEVERSION;]$(cat .node-version)" | |
id: nodenv | |
# 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@v1 | |
with: | |
node-version: "${{ steps.nodenv.outputs.NODEVERSION }}" | |
- run: npm install -g npm | |
# 無料版を(Pro版の中に)クローン | |
- run: git clone https://${GIT_USER}:${GIT_TOKEN}@github.com/${GIT_REPOSITORY} ./temp/plugins/vk-blocks | |
# VK Blocks の Githubにアクセスできるユーザーの設定 | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "github-workflows-vk-blocks-pro" | |
# # 無料版にデプロイするスクリプトにタグ名を引数で渡す。 | |
- run: bash bin/deploy-free.sh $RELEASE_VERSION |