-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (44 loc) · 2.19 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
51
52
53
# 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