|
@@ -18,6 +18,7 @@ jobs:
|
|
|
runs-on: [win-h5-only]
|
|
runs-on: [win-h5-only]
|
|
|
steps:
|
|
steps:
|
|
|
- name: Test SSH key
|
|
- name: Test SSH key
|
|
|
|
|
+ shell: bash
|
|
|
run: |
|
|
run: |
|
|
|
echo "${{ secrets.DEPLOY_KEY }}" > /tmp/test_key
|
|
echo "${{ secrets.DEPLOY_KEY }}" > /tmp/test_key
|
|
|
chmod 600 /tmp/test_key
|
|
chmod 600 /tmp/test_key
|
|
@@ -36,6 +37,7 @@ jobs:
|
|
|
run: npm install --force
|
|
run: npm install --force
|
|
|
|
|
|
|
|
- name: 构建 H5 (生产环境)
|
|
- name: 构建 H5 (生产环境)
|
|
|
|
|
+ shell: bash
|
|
|
env:
|
|
env:
|
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
|
TARO_API_URL: 'http://localhost:6001'
|
|
TARO_API_URL: 'http://localhost:6001'
|
|
@@ -51,9 +53,11 @@ jobs:
|
|
|
node .build/h5_for_production.js
|
|
node .build/h5_for_production.js
|
|
|
|
|
|
|
|
- name: Set timestamp version
|
|
- name: Set timestamp version
|
|
|
|
|
+ shell: bash
|
|
|
run: echo "VERSION=$(date +%Y%m%d-%H%M%S)" >> $GITHUB_ENV
|
|
run: echo "VERSION=$(date +%Y%m%d-%H%M%S)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Upload dist/h5/ to server
|
|
- name: Upload dist/h5/ to server
|
|
|
|
|
+ shell: bash
|
|
|
run: |
|
|
run: |
|
|
|
# 1. 将私钥写入临时文件
|
|
# 1. 将私钥写入临时文件
|
|
|
echo "${{ secrets.DEPLOY_KEY }}" > /tmp/deploy_key
|
|
echo "${{ secrets.DEPLOY_KEY }}" > /tmp/deploy_key
|
|
@@ -73,6 +77,7 @@ jobs:
|
|
|
rm -f /tmp/deploy_key
|
|
rm -f /tmp/deploy_key
|
|
|
|
|
|
|
|
- name: Update latest symlink
|
|
- name: Update latest symlink
|
|
|
|
|
+ shell: bash
|
|
|
run: |
|
|
run: |
|
|
|
echo "${{ secrets.DEPLOY_KEY }}" > /tmp/deploy_key
|
|
echo "${{ secrets.DEPLOY_KEY }}" > /tmp/deploy_key
|
|
|
chmod 600 /tmp/deploy_key
|
|
chmod 600 /tmp/deploy_key
|
|
@@ -81,4 +86,4 @@ jobs:
|
|
|
"${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \
|
|
"${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \
|
|
|
"cd ${{ secrets.DEPLOY_PATH }} && ln -sfn ${{ env.VERSION }} latest"
|
|
"cd ${{ secrets.DEPLOY_PATH }} && ln -sfn ${{ env.VERSION }} latest"
|
|
|
|
|
|
|
|
- rm -f /tmp/deploy_key
|
|
|
|
|
|
|
+ rm -f /tmp/deploy_key
|