-
-
Notifications
You must be signed in to change notification settings - Fork 46
144 lines (139 loc) · 5.1 KB
/
build.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: deploy to page
on:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: oprypin/find-latest-tag@v1
id: sch-latest-tag
with:
repository: jenkinsci/sonic-ci-helper-plugin
sort-tags: false
prefix: 'sonic-ci-helper'
- uses: oprypin/find-latest-tag@v1
id: sas-latest-tag
with:
repository: SonicCloudOrg/sonic-android-supply
sort-tags: false
- uses: oprypin/find-latest-tag@v1
id: saa-latest-tag
with:
repository: SonicCloudOrg/sonic-android-apk
sort-tags: false
- uses: oprypin/find-latest-tag@v1
id: sib-latest-tag
with:
repository: SonicCloudOrg/sonic-ios-bridge
sort-tags: false
- uses: oprypin/find-latest-tag@v1
id: sgm-latest-tag
with:
repository: SonicCloudOrg/sonic-go-mitmproxy
sort-tags: false
- uses: oprypin/find-latest-tag@v1
id: sdc-latest-tag
with:
repository: SonicCloudOrg/sonic-driver-core
sort-tags: false
- uses: oprypin/find-latest-tag@v1
id: ser-latest-tag
with:
repository: SonicCloudOrg/sonic-server
sort-tags: false
- name: JSON to variables
uses: antifree/json-to-variables@v1.0.1
with:
filename: 'version.json'
prefix: test
- name: replace saa
run: |
saa_new_ver=${{ steps.saa-latest-tag.outputs.tag }}
saa_old_ver=${{ env.test_saa }}
saa_old_ver_sub=${saa_old_ver:4}
sed -i "s/${saa_old_ver}/saa_${saa_new_ver}/g" version.json
sed -i "s/${saa_old_ver_sub}/${saa_new_ver}/g" src/saa/re-saa.md
- name: replace sib
run: |
sib_new_ver=${{ steps.sib-latest-tag.outputs.tag }}
sib_new_ver_sub=${sib_new_ver:1}
sib_old_ver=${{ env.test_sib }}
sib_old_ver_sub=${sib_old_ver:4}
sed -i "s/${sib_old_ver}/sib_${sib_new_ver_sub}/g" version.json
sed -i "s/${sib_old_ver_sub}/${sib_new_ver_sub}/g" src/sib/re-sib.md
- name: replace sas
run: |
sas_new_ver=${{ steps.sas-latest-tag.outputs.tag }}
sas_new_ver_sub=${sas_new_ver:1}
sas_old_ver=${{ env.test_sas }}
sas_old_ver_sub=${sas_old_ver:4}
sed -i "s/${sas_old_ver}/sas_${sas_new_ver_sub}/g" version.json
sed -i "s/${sas_old_ver_sub}/${sas_new_ver_sub}/g" src/sas/re-sas.md
- name: replace sgm
run: |
sgm_new_ver=${{ steps.sgm-latest-tag.outputs.tag }}
sgm_new_ver_sub=${sgm_new_ver:1}
sgm_old_ver=${{ env.test_sgm }}
sgm_old_ver_sub=${sgm_old_ver:4}
sed -i "s/${sgm_old_ver}/sgm_${sgm_new_ver_sub}/g" version.json
sed -i "s/${sgm_old_ver_sub}/${sgm_new_ver_sub}/g" src/sgm/re-sgm.md
- name: replace sdc
run: |
sdc_new_ver=${{ steps.sdc-latest-tag.outputs.tag }}
sdc_old_ver=${{ env.test_sdc }}
sdc_old_ver_sub=${sdc_old_ver:4}
sed -i "s/${sdc_old_ver}/sdc_${sdc_new_ver}/g" version.json
sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/re-sdc.md
sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/sdc-android.md
sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/sdc-ios.md
sed -i "s/${sdc_old_ver_sub}/${sdc_new_ver}/g" src/sdc/sdc-poco.md
- name: replace sch
run: |
sch_new_ver=${{ steps.sch-latest-tag.outputs.tag }}
sch_old_ver=${{ env.test_sch }}
sch_old_ver_sub=${sch_old_ver:4}
sed -i "s/${sch_old_ver}/sch_${sch_new_ver}/g" version.json
sed -i "s/${sch_old_ver_sub}/${sch_new_ver}/g" src/sch/re-sch.md
- name: replace server
run: |
ser_new_ver=${{ steps.ser-latest-tag.outputs.tag }}
ser_old_ver=${{ env.test_ser }}
ser_old_ver_sub=${ser_old_ver:4}
sed -i "s/${ser_old_ver}/ser_${ser_new_ver}/g" version.json
sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/deploy/agent-deploy.md
sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/deploy/back-end-deploy.md
sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/en/deploy/agent-deploy.md
sed -i "s/${ser_old_ver_sub}/${ser_new_ver}/g" src/en/deploy/back-end-deploy.md
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'npm'
- run: npm install
- run: npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: .vitepress/dist
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4