|
1 |
| -name: deploy to ALIYUN |
| 1 | +# name: deploy to ALIYUN |
2 | 2 |
|
3 |
| -on: |
4 |
| - workflow_dispatch: |
5 |
| - push: |
6 |
| - branches: [ main ] |
| 3 | +# on: |
| 4 | +# workflow_dispatch: |
| 5 | +# push: |
| 6 | +# branches: [ main ] |
7 | 7 |
|
8 |
| -jobs: |
9 |
| - deploy: |
10 |
| - runs-on: ubuntu-latest |
11 |
| - steps: |
12 |
| - - uses: actions/checkout@v2 |
13 |
| - with: |
14 |
| - fetch-depth: 0 |
15 |
| - - uses: oprypin/find-latest-tag@v1 |
16 |
| - id: sch-latest-tag |
17 |
| - with: |
18 |
| - repository: jenkinsci/sonic-ci-helper-plugin |
19 |
| - sort-tags: false |
20 |
| - prefix: 'sonic-ci-helper' |
21 |
| - - uses: oprypin/find-latest-tag@v1 |
22 |
| - id: sas-latest-tag |
23 |
| - with: |
24 |
| - repository: SonicCloudOrg/sonic-android-supply |
25 |
| - sort-tags: false |
26 |
| - - uses: oprypin/find-latest-tag@v1 |
27 |
| - id: saa-latest-tag |
28 |
| - with: |
29 |
| - repository: SonicCloudOrg/sonic-android-apk |
30 |
| - sort-tags: false |
31 |
| - - uses: oprypin/find-latest-tag@v1 |
32 |
| - id: sib-latest-tag |
33 |
| - with: |
34 |
| - repository: SonicCloudOrg/sonic-ios-bridge |
35 |
| - sort-tags: false |
36 |
| - - uses: oprypin/find-latest-tag@v1 |
37 |
| - id: sgm-latest-tag |
38 |
| - with: |
39 |
| - repository: SonicCloudOrg/sonic-go-mitmproxy |
40 |
| - sort-tags: false |
41 |
| - - uses: oprypin/find-latest-tag@v1 |
42 |
| - id: sdc-latest-tag |
43 |
| - with: |
44 |
| - repository: SonicCloudOrg/sonic-driver-core |
45 |
| - sort-tags: false |
46 |
| - - uses: oprypin/find-latest-tag@v1 |
47 |
| - id: ser-latest-tag |
48 |
| - with: |
49 |
| - repository: SonicCloudOrg/sonic-server |
50 |
| - sort-tags: false |
51 |
| - - name: JSON to variables |
52 |
| - uses: antifree/json-to-variables@v1.0.1 |
53 |
| - with: |
54 |
| - filename: 'version.json' |
55 |
| - prefix: test |
56 |
| - - name: replace saa |
57 |
| - run: | |
58 |
| - saa_new_ver=${{ steps.saa-latest-tag.outputs.tag }} |
59 |
| - saa_old_ver=${{ env.test_saa }} |
60 |
| - saa_old_ver_sub=${saa_old_ver:4} |
61 |
| - sed -i "s/${saa_old_ver}/saa_${saa_new_ver}/g" version.json |
62 |
| - sed -i "s/${saa_old_ver_sub}/${saa_new_ver}/g" src/saa/re-saa.md |
63 |
| - - name: replace sib |
64 |
| - run: | |
65 |
| - sib_new_ver=${{ steps.sib-latest-tag.outputs.tag }} |
66 |
| - sib_new_ver_sub=${sib_new_ver:1} |
67 |
| - sib_old_ver=${{ env.test_sib }} |
68 |
| - sib_old_ver_sub=${sib_old_ver:4} |
69 |
| - sed -i "s/${sib_old_ver}/sib_${sib_new_ver_sub}/g" version.json |
70 |
| - sed -i "s/${sib_old_ver_sub}/${sib_new_ver_sub}/g" src/sib/re-sib.md |
71 |
| - - name: replace sas |
72 |
| - run: | |
73 |
| - sas_new_ver=${{ steps.sas-latest-tag.outputs.tag }} |
74 |
| - sas_new_ver_sub=${sas_new_ver:1} |
75 |
| - sas_old_ver=${{ env.test_sas }} |
76 |
| - sas_old_ver_sub=${sas_old_ver:4} |
77 |
| - sed -i "s/${sas_old_ver}/sas_${sas_new_ver_sub}/g" version.json |
78 |
| - sed -i "s/${sas_old_ver_sub}/${sas_new_ver_sub}/g" src/sas/re-sas.md |
79 |
| - - name: replace sgm |
80 |
| - run: | |
81 |
| - sgm_new_ver=${{ steps.sgm-latest-tag.outputs.tag }} |
82 |
| - sgm_new_ver_sub=${sgm_new_ver:1} |
83 |
| - sgm_old_ver=${{ env.test_sgm }} |
84 |
| - sgm_old_ver_sub=${sgm_old_ver:4} |
85 |
| - sed -i "s/${sgm_old_ver}/sgm_${sgm_new_ver_sub}/g" version.json |
86 |
| - sed -i "s/${sgm_old_ver_sub}/${sgm_new_ver_sub}/g" src/sgm/re-sgm.md |
87 |
| - - name: replace sdc |
88 |
| - run: | |
89 |
| - sdc_new_ver=${{ steps.sdc-latest-tag.outputs.tag }} |
90 |
| - sdc_old_ver=${{ env.test_sdc }} |
91 |
| - sdc_old_ver_sub=${sdc_old_ver:4} |
92 |
| - sed -i "s/${sdc_old_ver}/sdc_${sdc_new_ver}/g" version.json |
93 |
| - sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/re-sdc.md |
94 |
| - sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/sdc-android.md |
95 |
| - sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/sdc-ios.md |
96 |
| - sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/sdc-poco.md |
97 |
| - - name: replace sch |
98 |
| - run: | |
99 |
| - sch_new_ver=${{ steps.sch-latest-tag.outputs.tag }} |
100 |
| - sch_old_ver=${{ env.test_sch }} |
101 |
| - sch_old_ver_sub=${sch_old_ver:4} |
102 |
| - sed -i "s/${sch_old_ver}/sch_${sch_new_ver}/g" version.json |
103 |
| - sed -i "s/${sch_old_ver_sub}/${sch_new_ver}/g" src/sch/re-sch.md |
104 |
| - - name: replace server |
105 |
| - run: | |
106 |
| - ser_new_ver=${{ steps.ser-latest-tag.outputs.tag }} |
107 |
| - ser_old_ver=${{ env.test_ser }} |
108 |
| - ser_old_ver_sub=${ser_old_ver:4} |
109 |
| - sed -i "s/${ser_old_ver}/ser_${ser_new_ver}/g" version.json |
110 |
| - sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/deploy/agent-deploy.md |
111 |
| - sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/deploy/back-end-deploy.md |
112 |
| - sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/en/deploy/agent-deploy.md |
113 |
| - sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/en/deploy/back-end-deploy.md |
114 |
| - - name: Use Node.js 16.x |
115 |
| - uses: actions/setup-node@v2 |
116 |
| - with: |
117 |
| - node-version: 16.x |
118 |
| - cache: 'npm' |
119 |
| - - run: npm install |
120 |
| - - run: npm run build |
121 |
| - - name: Create Pull Request |
122 |
| - id: cpr |
123 |
| - uses: peter-evans/create-pull-request@v4 |
124 |
| - with: |
125 |
| - commit-message: Update doc files. |
126 |
| - author: GitHub <noreply@github.com> |
127 |
| - signoff: false |
128 |
| - branch: deploy |
129 |
| - base: main |
130 |
| - labels: document |
131 |
| - delete-branch: true |
132 |
| - title: 'doc: update files and ready to deploy' |
133 |
| - body: | |
134 |
| - **在提出此拉取请求时,我确认了以下几点(保存后请点击复选框):** |
| 8 | +# jobs: |
| 9 | +# deploy: |
| 10 | +# runs-on: ubuntu-latest |
| 11 | +# steps: |
| 12 | +# - uses: actions/checkout@v2 |
| 13 | +# with: |
| 14 | +# fetch-depth: 0 |
| 15 | +# - uses: oprypin/find-latest-tag@v1 |
| 16 | +# id: sch-latest-tag |
| 17 | +# with: |
| 18 | +# repository: jenkinsci/sonic-ci-helper-plugin |
| 19 | +# sort-tags: false |
| 20 | +# prefix: 'sonic-ci-helper' |
| 21 | +# - uses: oprypin/find-latest-tag@v1 |
| 22 | +# id: sas-latest-tag |
| 23 | +# with: |
| 24 | +# repository: SonicCloudOrg/sonic-android-supply |
| 25 | +# sort-tags: false |
| 26 | +# - uses: oprypin/find-latest-tag@v1 |
| 27 | +# id: saa-latest-tag |
| 28 | +# with: |
| 29 | +# repository: SonicCloudOrg/sonic-android-apk |
| 30 | +# sort-tags: false |
| 31 | +# - uses: oprypin/find-latest-tag@v1 |
| 32 | +# id: sib-latest-tag |
| 33 | +# with: |
| 34 | +# repository: SonicCloudOrg/sonic-ios-bridge |
| 35 | +# sort-tags: false |
| 36 | +# - uses: oprypin/find-latest-tag@v1 |
| 37 | +# id: sgm-latest-tag |
| 38 | +# with: |
| 39 | +# repository: SonicCloudOrg/sonic-go-mitmproxy |
| 40 | +# sort-tags: false |
| 41 | +# - uses: oprypin/find-latest-tag@v1 |
| 42 | +# id: sdc-latest-tag |
| 43 | +# with: |
| 44 | +# repository: SonicCloudOrg/sonic-driver-core |
| 45 | +# sort-tags: false |
| 46 | +# - uses: oprypin/find-latest-tag@v1 |
| 47 | +# id: ser-latest-tag |
| 48 | +# with: |
| 49 | +# repository: SonicCloudOrg/sonic-server |
| 50 | +# sort-tags: false |
| 51 | +# - name: JSON to variables |
| 52 | +# uses: antifree/json-to-variables@v1.0.1 |
| 53 | +# with: |
| 54 | +# filename: 'version.json' |
| 55 | +# prefix: test |
| 56 | +# - name: replace saa |
| 57 | +# run: | |
| 58 | +# saa_new_ver=${{ steps.saa-latest-tag.outputs.tag }} |
| 59 | +# saa_old_ver=${{ env.test_saa }} |
| 60 | +# saa_old_ver_sub=${saa_old_ver:4} |
| 61 | +# sed -i "s/${saa_old_ver}/saa_${saa_new_ver}/g" version.json |
| 62 | +# sed -i "s/${saa_old_ver_sub}/${saa_new_ver}/g" src/saa/re-saa.md |
| 63 | +# - name: replace sib |
| 64 | +# run: | |
| 65 | +# sib_new_ver=${{ steps.sib-latest-tag.outputs.tag }} |
| 66 | +# sib_new_ver_sub=${sib_new_ver:1} |
| 67 | +# sib_old_ver=${{ env.test_sib }} |
| 68 | +# sib_old_ver_sub=${sib_old_ver:4} |
| 69 | +# sed -i "s/${sib_old_ver}/sib_${sib_new_ver_sub}/g" version.json |
| 70 | +# sed -i "s/${sib_old_ver_sub}/${sib_new_ver_sub}/g" src/sib/re-sib.md |
| 71 | +# - name: replace sas |
| 72 | +# run: | |
| 73 | +# sas_new_ver=${{ steps.sas-latest-tag.outputs.tag }} |
| 74 | +# sas_new_ver_sub=${sas_new_ver:1} |
| 75 | +# sas_old_ver=${{ env.test_sas }} |
| 76 | +# sas_old_ver_sub=${sas_old_ver:4} |
| 77 | +# sed -i "s/${sas_old_ver}/sas_${sas_new_ver_sub}/g" version.json |
| 78 | +# sed -i "s/${sas_old_ver_sub}/${sas_new_ver_sub}/g" src/sas/re-sas.md |
| 79 | +# - name: replace sgm |
| 80 | +# run: | |
| 81 | +# sgm_new_ver=${{ steps.sgm-latest-tag.outputs.tag }} |
| 82 | +# sgm_new_ver_sub=${sgm_new_ver:1} |
| 83 | +# sgm_old_ver=${{ env.test_sgm }} |
| 84 | +# sgm_old_ver_sub=${sgm_old_ver:4} |
| 85 | +# sed -i "s/${sgm_old_ver}/sgm_${sgm_new_ver_sub}/g" version.json |
| 86 | +# sed -i "s/${sgm_old_ver_sub}/${sgm_new_ver_sub}/g" src/sgm/re-sgm.md |
| 87 | +# - name: replace sdc |
| 88 | +# run: | |
| 89 | +# sdc_new_ver=${{ steps.sdc-latest-tag.outputs.tag }} |
| 90 | +# sdc_old_ver=${{ env.test_sdc }} |
| 91 | +# sdc_old_ver_sub=${sdc_old_ver:4} |
| 92 | +# sed -i "s/${sdc_old_ver}/sdc_${sdc_new_ver}/g" version.json |
| 93 | +# sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/re-sdc.md |
| 94 | +# sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/sdc-android.md |
| 95 | +# sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/sdc-ios.md |
| 96 | +# sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/sdc-poco.md |
| 97 | +# - name: replace sch |
| 98 | +# run: | |
| 99 | +# sch_new_ver=${{ steps.sch-latest-tag.outputs.tag }} |
| 100 | +# sch_old_ver=${{ env.test_sch }} |
| 101 | +# sch_old_ver_sub=${sch_old_ver:4} |
| 102 | +# sed -i "s/${sch_old_ver}/sch_${sch_new_ver}/g" version.json |
| 103 | +# sed -i "s/${sch_old_ver_sub}/${sch_new_ver}/g" src/sch/re-sch.md |
| 104 | +# - name: replace server |
| 105 | +# run: | |
| 106 | +# ser_new_ver=${{ steps.ser-latest-tag.outputs.tag }} |
| 107 | +# ser_old_ver=${{ env.test_ser }} |
| 108 | +# ser_old_ver_sub=${ser_old_ver:4} |
| 109 | +# sed -i "s/${ser_old_ver}/ser_${ser_new_ver}/g" version.json |
| 110 | +# sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/deploy/agent-deploy.md |
| 111 | +# sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/deploy/back-end-deploy.md |
| 112 | +# sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/en/deploy/agent-deploy.md |
| 113 | +# sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/en/deploy/back-end-deploy.md |
| 114 | +# - name: Use Node.js 16.x |
| 115 | +# uses: actions/setup-node@v2 |
| 116 | +# with: |
| 117 | +# node-version: 16.x |
| 118 | +# cache: 'npm' |
| 119 | +# - run: npm install |
| 120 | +# - run: npm run build |
| 121 | +# - name: Create Pull Request |
| 122 | +# id: cpr |
| 123 | +# uses: peter-evans/create-pull-request@v4 |
| 124 | +# with: |
| 125 | +# commit-message: Update doc files. |
| 126 | +# author: GitHub <noreply@github.com> |
| 127 | +# signoff: false |
| 128 | +# branch: deploy |
| 129 | +# base: main |
| 130 | +# labels: document |
| 131 | +# delete-branch: true |
| 132 | +# title: 'doc: update files and ready to deploy' |
| 133 | +# body: | |
| 134 | +# **在提出此拉取请求时,我确认了以下几点(保存后请点击复选框):** |
135 | 135 |
|
136 |
| - - [x] 标题为fix、feat或doc开头 |
137 |
| - - [x] 我已检查没有与此请求重复的拉取请求。 |
138 |
| - - [x] 我已经考虑过,并确认这份呈件对其他人很有价值。 |
139 |
| - - [x] 我接受此提交可能不会被使用,并根据维护人员的意愿关闭拉取请求。 |
| 136 | +# - [x] 标题为fix、feat或doc开头 |
| 137 | +# - [x] 我已检查没有与此请求重复的拉取请求。 |
| 138 | +# - [x] 我已经考虑过,并确认这份呈件对其他人很有价值。 |
| 139 | +# - [x] 我接受此提交可能不会被使用,并根据维护人员的意愿关闭拉取请求。 |
140 | 140 |
|
141 |
| - **填写PR内容:** |
| 141 | +# **填写PR内容:** |
142 | 142 |
|
143 |
| - - Update files to deploy by bot 🚀. |
| 143 | +# - Update files to deploy by bot 🚀. |
144 | 144 |
|
145 |
| - draft: false |
146 |
| - - name: Auto approve |
147 |
| - if: steps.cpr.outputs.pull-request-operation == 'created' |
148 |
| - uses: juliangruber/approve-pull-request-action@v1 |
149 |
| - with: |
150 |
| - github-token: ${{ secrets.PAT }} |
151 |
| - number: ${{ steps.cpr.outputs.pull-request-number }} |
152 |
| - - id: automerge |
153 |
| - name: automerge |
154 |
| - if: steps.cpr.outputs.pull-request-operation == 'created' |
155 |
| - uses: "pascalgn/automerge-action@v0.15.3" |
156 |
| - env: |
157 |
| - MERGE_LABELS: "document" |
158 |
| - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
159 |
| - PULL_REQUEST: ${{ steps.cpr.outputs.pull-request-number }} |
160 |
| - MERGE_RETRIES: 18 |
161 |
| - MERGE_DELETE_BRANCH: true |
162 |
| - MERGE_RETRY_SLEEP: 10000 |
163 |
| - - name: mv logo file |
164 |
| - run: | |
165 |
| - mv .vitepress/theme/assets/logo-full.png .vitepress/dist |
166 |
| - mv .vitepress/theme/assets/public/favicon.ico .vitepress/dist |
167 |
| - mv .vitepress/theme/assets/wechat.jpg .vitepress/dist |
168 |
| - mv .vitepress/theme/assets/ide.json .vitepress/dist |
169 |
| - - name: upload files to OSS |
170 |
| - uses: fangbinwei/aliyun-oss-website-action@v1 |
171 |
| - with: |
172 |
| - accessKeyId: ${{ secrets.ALIYUN_ACCESS_KEY_ID }} |
173 |
| - accessKeySecret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }} |
174 |
| - bucket: sonic-cloud |
175 |
| - endpoint: oss-cn-hongkong.aliyuncs.com |
176 |
| - folder: .vitepress/dist |
177 |
| - incremental: false |
178 |
| - skipSetting: true |
| 145 | +# draft: false |
| 146 | +# - name: Auto approve |
| 147 | +# if: steps.cpr.outputs.pull-request-operation == 'created' |
| 148 | +# uses: juliangruber/approve-pull-request-action@v1 |
| 149 | +# with: |
| 150 | +# github-token: ${{ secrets.PAT }} |
| 151 | +# number: ${{ steps.cpr.outputs.pull-request-number }} |
| 152 | +# - id: automerge |
| 153 | +# name: automerge |
| 154 | +# if: steps.cpr.outputs.pull-request-operation == 'created' |
| 155 | +# uses: "pascalgn/automerge-action@v0.15.3" |
| 156 | +# env: |
| 157 | +# MERGE_LABELS: "document" |
| 158 | +# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 159 | +# PULL_REQUEST: ${{ steps.cpr.outputs.pull-request-number }} |
| 160 | +# MERGE_RETRIES: 18 |
| 161 | +# MERGE_DELETE_BRANCH: true |
| 162 | +# MERGE_RETRY_SLEEP: 10000 |
| 163 | +# - name: mv logo file |
| 164 | +# run: | |
| 165 | +# mv .vitepress/theme/assets/logo-full.png .vitepress/dist |
| 166 | +# mv .vitepress/theme/assets/public/favicon.ico .vitepress/dist |
| 167 | +# mv .vitepress/theme/assets/wechat.jpg .vitepress/dist |
| 168 | +# mv .vitepress/theme/assets/ide.json .vitepress/dist |
| 169 | +# - name: upload files to OSS |
| 170 | +# uses: fangbinwei/aliyun-oss-website-action@v1 |
| 171 | +# with: |
| 172 | +# accessKeyId: ${{ secrets.ALIYUN_ACCESS_KEY_ID }} |
| 173 | +# accessKeySecret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }} |
| 174 | +# bucket: sonic-cloud |
| 175 | +# endpoint: oss-cn-hongkong.aliyuncs.com |
| 176 | +# folder: .vitepress/dist |
| 177 | +# incremental: false |
| 178 | +# skipSetting: true |
0 commit comments