-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (40 loc) · 2.11 KB
/
deploy-free.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 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