-
-
Notifications
You must be signed in to change notification settings - Fork 4
361 lines (316 loc) · 23.6 KB
/
ci.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
name: CI
env:
CARGO_TERM_COLOR: always
MSRV: 1.56.0
on:
push:
# branches:
# - main
tags:
- v*
jobs:
check:
name: Rust project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout google/comprehensive-rust code
uses: actions/checkout@v4
with:
repository: google/comprehensive-rust
path: 'comprehensive-rust'
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly -c rust-docs
rustup default nightly
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> $GITHUB_PATH
- run: mkdir dist
- run: git clone https://github.com/rust-lang-cn/rust-by-example-cn.git -b gh-pages dist/rust-by-example-cn --depth 1
- run: git clone https://github.com/rust-lang-cn/book-cn.git -b gh-pages dist/book --depth 1
- run: git clone https://github.com/rust-lang-cn/std-cn.git -b main std --depth 1
- run: git clone https://github.com/rust-lang-cn/reference-cn.git -b master reference-cn --depth 1
- run: git clone https://github.com/rust-lang-cn/rustdoc-cn.git -b master rustdoc-cn --depth 1
- run: git clone https://github.com/zzy/rust-cookbook-zh-cn.git -b master rust-cookbook-cn --depth 1
- run: git clone https://github.com/rust-lang-cn/cargo-cn.git -b master cargo --depth 1
- run: git clone https://github.com/rust-lang-cn/edition-guide-cn.git -b master edition-guide --depth 1
- run: git clone https://github.com/rust-lang-cn/nomicon-zh-Hans.git -b main nomicon --depth 1
- run: git clone https://github.com/jaywcjlove/reference.git -b gh-pages quick-reference --depth 1
- run: git clone https://github.com/sunface/rust-course.git -b gh-pages rust-course --depth 1
- run: git clone https://github.com/rustlang-cn/rusty-book.git -b gh-pages rusty-book --depth 1
- run: cp -rp std/doc dist/std
- run: rm -rf dist/book/.git
- run: rm -rf dist/rust-by-example-cn/.git
- run: rm -rf rustdoc-cn/.git
- run: rm -rf reference-cn/.git
- run: rm -rf comprehensive-rust/.git
- run: rm -rf rust-cookbook-cn/.git
- run: rm -rf cargo/.git
- run: rm -rf edition-guide/.git
- run: rm -rf quick-reference/.git
- run: cp -rp quick-reference dist/quick-reference
- run: rm -rf rust-course/.git
- run: cp -rp rust-course dist/rust-course
- run: rm -rf rusty-book/.git
- run: cp -rp rusty-book dist/rusty-book
- name: reference-cn
working-directory: reference-cn
run: |
mdbook build
- name: rustdoc-cn
working-directory: rustdoc-cn
run: |
mdbook build
- name: rust-cookbook-cn
working-directory: rust-cookbook-cn
run: |
mdbook build
- name: cargo
working-directory: cargo
run: |
mdbook build
- name: edition-guide
working-directory: edition-guide
run: |
mdbook build
- name: nomicon
working-directory: nomicon
run: |
mdbook build
- name: comprehensive-rust
working-directory: comprehensive-rust
env:
MDBOOK_BOOK__LANGUAGE: zh-CN
run: |
cargo install mdbook-svgbob
cargo install mdbook-i18n-helpers
cargo install --path mdbook-exerciser
cargo install --path mdbook-course
mdbook build -d book/zh-CN
- run: |
cp -rp reference-cn/book dist/reference
cp -rp rustdoc-cn/book dist/rustdoc
cp -rp rust-cookbook-cn/book dist/rust-cookbook
cp -rp cargo/book dist/cargo
cp -rp edition-guide/book dist/edition-guide
cp -rp nomicon/book dist/nomicon
cp -rp comprehensive-rust/book/zh-CN/html dist/comprehensive-rust
- name: Create index.html
working-directory: ./dist
run: |
cat > index.html << EOF
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rust 相关中文文档</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; }
h1 { text-align: center; }
ul,li { padding: 0; margin: 0; list-style: none;}
ul { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 480px; margin: 2.6rem auto;}
ul li a {
display: flex;
align-items: center;
cursor: pointer;
border-radius: 0.3rem;
height: 4rem;
box-shadow: 0 0 #0000, 0 0 #0000, 0 2px 3px 0 rgb(0 0 0 / 5%);
background-color: #e2e5e6;
--bg-opacity: 0.2;
background-color: rgb(62 69 72 / var(--bg-opacity));
transition: all 0.3s;
padding: 0rem 1.3rem;
font-weight: 300;
text-decoration: none;
}
ul li a:hover {
--bg-opacity: 0.3;
}
</style>
</head>
<body>
<header>
<a href="https://github.com/jaywcjlove/rust-cn-document-for-docker" target="__blank">Github</a>
</header>
<h1>Rust 相关中文文档</h1>
<ul>
<li><a href="book/" target="__blank"> Rust 程序设计语言中文版 </a></li>
<li><a href="cargo/" target="__blank"> Cargo 手册中文版 </a></li>
<li><a href="edition-guide/" target="__blank"> Rust 版本指南 </a></li>
<li><a href="reference/" target="__blank"> Rust 参考手册中文版 </a></li>
<li><a href="rustdoc/" target="__blank"> RustDoc 手册中文版 </a></li>
<li><a href="rust-cookbook/" target="__blank"> Rust Cookbook 中文版 </a></li>
<li><a href="std/std/" target="__blank"> Rust 标准库文档中文版 </a></li>
<li><a href="rust-by-example-cn/" target="__blank"> Rust By Example 中文版 </a></li>
<li><a href="nomicon/" target="__blank"> Rust 秘典 </a></li>
<li><a href="quick-reference/docs/cargo.html" target="__blank"> Cargo 备忘清单(速查表) </a></li>
<li><a href="quick-reference/docs/rust.html" target="__blank"> Rust 备忘清单(速查表) </a></li>
<li><a href="quick-reference/index.html" target="__blank"> Quick Reference (速查表) </a></li>
<li><a href="rust-course/index.html" target="__blank"> Rust 语言圣经 </a></li>
<li><a href="rusty-book/index.html" target="__blank"> Rusty Book(锈书) </a></li>
<li><a href="comprehensive-rust/index.html" target="__blank"> Comprehensive Rust 🦀 </a></li>
</ul>
</body>
</html>
EOF
- name: Create README.md
working-directory: ./dist
run: |
cat > README.md << EOF
本仓库,将来自 [**@rust-lang-cn**](https://github.com/rust-lang-cn) 中 Rust 相关的中文文档仓库打包到 Docker 中,用于本地部署预览:
Github Repo | last commit | home
---- | ---- | ----
[Rust 标准库文档中文版](https://github.com/rust-lang-cn/std-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/std-cn?style=flat&label=last)](https://github.com/rust-lang-cn/std-cn/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/std/std/)
[Rust 程序设计语言 中文版](https://github.com/rust-lang-cn/book-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/book-cn?style=flat&label=last)](https://github.com/rust-lang-cn/book-cn/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/book/)
[Rust By Example 中文版](https://github.com/rust-lang-cn/rust-by-example-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/rust-by-example-cn?style=flat&label=last)](https://github.com/rust-lang-cn/rust-by-example-cn/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/rust-by-example-cn/)
[Rust 参考手册中文版](https://github.com/rust-lang-cn/reference-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/reference-cn?style=flat&label=last)](https://github.com/rust-lang-cn/reference-cn/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/reference/)
[RustDoc 手册中文版](https://github.com/rust-lang-cn/rustdoc-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/rustdoc-cn?style=flat&label=last)](https://github.com/rust-lang-cn/rustdoc-cn/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/rustdoc/)
[Rust Cookbook 中文版](https://github.com/rust-lang-cn/rust-cookbook-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/rust-cookbook-cn?style=flat&label=last)](https://github.com/rust-lang-cn/rust-cookbook-cn/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/rust-cookbook/)
[Rust 版本指南](https://github.com/rust-lang-cn/edition-guide) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/edition-guide?style=flat&label=last)](https://github.com/rust-lang-cn/edition-guide/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/edition-guide/)
[Cargo 手册](https://github.com/rust-lang-cn/cargo-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/cargo-cn?style=flat&label=last)](https://github.com/rust-lang-cn/cargo-cn/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/cargo/)
[Rust 秘典](https://github.com/rust-lang-cn/nomicon-zh-Hans) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/nomicon-zh-Hans?style=flat&label=last)](https://github.com/rust-lang-cn/nomicon-zh-Hans/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/nomicon/)
[Cargo 备忘清单(速查表)](https://github.com/jaywcjlove/reference) | [![GitHub last commit](https://img.shields.io/github/last-commit/jaywcjlove/reference?style=flat&label=last)](https://github.com/jaywcjlove/reference/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/quick-reference/docs/cargo.html)
[Rust 备忘清单(速查表)](https://github.com/jaywcjlove/reference) | [![GitHub last commit](https://img.shields.io/github/last-commit/jaywcjlove/reference?style=flat&label=last)](https://github.com/jaywcjlove/reference/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/quick-reference/docs/rust.html)
[Quick Reference(速查表)](https://github.com/jaywcjlove/reference) | [![GitHub last commit](https://img.shields.io/github/last-commit/jaywcjlove/reference?style=flat&label=last)](https://github.com/jaywcjlove/reference/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/quick-reference/index.html)
[Rust 语言圣经](https://github.com/sunface/rust-course) | [![GitHub last commit](https://img.shields.io/github/last-commit/sunface/rust-course?style=flat&label=last)](https://github.com/sunface/rust-course/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/rust-course/index.html)
[Rusty Book(锈书)](https://github.com/rustlang-cn/rusty-book) | [![GitHub last commit](https://img.shields.io/github/last-commit/rustlang-cn/rusty-book?style=flat&label=last)](https://github.com/rustlang-cn/rusty-book/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/rusty-book/index.html)
[Comprehensive Rust 🦀](https://github.com/google/comprehensive-rust) | [![GitHub last commit](https://img.shields.io/github/last-commit/google/comprehensive-rust?style=flat&label=last)](https://github.com/google/comprehensive-rust/commits) | [#home](https://jaywcjlove.github.io/rust-cn-document-for-docker/comprehensive-rust/index.html)
EOF
- name: Deploy Website
uses: peaceiris/actions-gh-pages@v3
with:
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
with:
filter-author: (小弟调调™)
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
文档: ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
比较变化: ${{ steps.changelog.outputs.compareurl }}
Github Repo | last commit | home
---- | ---- | ----
[Rust 标准库文档中文版](https://github.com/rust-lang-cn/std-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/std-cn?style=flat&label=last)](https://github.com/rust-lang-cn/std-cn/commits) | [#home](https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/std/std/)
[Rust 程序设计语言 中文版](https://github.com/rust-lang-cn/book-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/book-cn?style=flat&label=last)](https://github.com/rust-lang-cn/book-cn/commits) | [#home](https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/book/)
[Rust By Example 中文版](https://github.com/rust-lang-cn/rust-by-example-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/rust-by-example-cn?style=flat&label=last)](https://github.com/rust-lang-cn/rust-by-example-cn/commits) | [#home](https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/rust-by-example-cn/)
[Rust 参考手册中文版](https://github.com/rust-lang-cn/reference-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/reference-cn?style=flat&label=last)](https://github.com/rust-lang-cn/reference-cn/commits) | [#home](https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/reference/)
[RustDoc 手册中文版](https://github.com/rust-lang-cn/rustdoc-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/rustdoc-cn?style=flat&label=last)](https://github.com/rust-lang-cn/rustdoc-cn/commits) | [#home](https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/rustdoc/)
[Rust Cookbook 中文版](https://github.com/rust-lang-cn/rust-cookbook-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/rust-cookbook-cn?style=flat&label=last)](https://github.com/rust-lang-cn/rust-cookbook-cn/commits) | [#home](https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/rust-cookbook/)
[Rust 版本指南](https://github.com/rust-lang-cn/edition-guide) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/edition-guide?style=flat&label=last)](https://github.com/rust-lang-cn/edition-guide/commits) | [#home](https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/edition-guide/)
[Cargo 手册](https://github.com/rust-lang-cn/cargo-cn) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/cargo-cn?style=flat&label=last)](https://github.com/rust-lang-cn/cargo-cn/commits) | [#home](https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/cargo/)
[Rust 秘典](https://github.com/rust-lang-cn/nomicon-zh-Hans) | [![GitHub last commit](https://img.shields.io/github/last-commit/rust-lang-cn/nomicon-zh-Hans?style=flat&label=last)](https://github.com/rust-lang-cn/nomicon-zh-Hans/commits) | [#home](https://raw.githack.com/jaywcjlove/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/nomicon/)
[Cargo 备忘清单(速查表)](https://github.com/jaywcjlove/reference) | [![GitHub last commit](https://img.shields.io/github/last-commit/jaywcjlove/reference?style=flat&label=last)](https://github.com/jaywcjlove/reference/commits) | [#home](https://raw.githack.com/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/quick-reference/docs/cargo.html)
[Rust 备忘清单(速查表)](https://github.com/jaywcjlove/reference) | [![GitHub last commit](https://img.shields.io/github/last-commit/jaywcjlove/reference?style=flat&label=last)](https://github.com/jaywcjlove/reference/commits) | [#home](https://raw.githack.com/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/quick-reference/docs/rust.html)
[Quick Reference(速查表)](https://github.com/jaywcjlove/reference) | [![GitHub last commit](https://img.shields.io/github/last-commit/jaywcjlove/reference?style=flat&label=last)](https://github.com/jaywcjlove/reference/commits) | [#home](https://raw.githack.com/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/quick-reference/index.html)
[Rust 语言圣经](https://github.com/sunface/rust-course) | [![GitHub last commit](https://img.shields.io/github/last-commit/sunface/rust-course?style=flat&label=last)](https://github.com/sunface/rust-course/commits) | [#home](https://raw.githack.com/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/rust-course/index.html)
[Rusty Book(锈书)](https://github.com/rustlang-cn/rusty-book) | [![GitHub last commit](https://img.shields.io/github/last-commit/rustlang-cn/rusty-book?style=flat&label=last)](https://github.com/rustlang-cn/rusty-book/commits) | [#home](https://raw.githack.com/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/rusty-book/index.html)
[Comprehensive Rust 🦀](https://github.com/google/comprehensive-rust) | [![GitHub last commit](https://img.shields.io/github/last-commit/google/comprehensive-rust?style=flat&label=last)](https://github.com/google/comprehensive-rust/commits) | [#home](https://raw.githack.com/rust-cn-document-for-docker/${{ steps.changelog.outputs.gh-pages-short-hash }}/comprehensive-rust/index.html)
${{ steps.changelog.outputs.changelog }}
# Create Docker Image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push image:latest
uses: docker/build-push-action@v3
with:
push: true
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ secrets.DOCKER_USER }}/rust-cn-document-for-docker:latest
- name: Print tag version
run: |
echo "Tag version: ${GITHUB_REF#refs/tags/v}"
- name: Set version variable
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Build and push image:tags
uses: docker/build-push-action@v3
with:
push: true
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ secrets.DOCKER_USER }}/rust-cn-document-for-docker:${{ env.VERSION }}
- name: Modify README.md
uses: jaywcjlove/github-action-modify-file-content@main
with:
path: README.md
# Create Docker Image in Github
# - name: Login to the GitHub Container Registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push image:latest
# uses: docker/build-push-action@v3
# with:
# push: true
# context: .
# platforms: linux/amd64,linux/arm64
# tags: ghcr.io/jaywcjlove/rust-cn-document-for-docker:latest
# - name: Build and push image:tags
# uses: docker/build-push-action@v3
# if: steps.create_tag.outputs.successful
# with:
# push: true
# context: .
# platforms: linux/amd64,linux/arm64
# tags: ghcr.io/jaywcjlove/rust-cn-document-for-docker:${{steps.changelog.outputs.version}}
# # Create Docker Image
# - name: Docker login
# run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
# - name: Build rust-cn-document-for-docker image
# run: docker image build -t rust-cn-document-for-docker .
# - name: Tags & Push image
# run: |
# # Strip git ref prefix from version
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# # Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# echo "outputs.tag - $VERSION"
# docker tag rust-cn-document-for-docker ${{ secrets.DOCKER_USER }}/rust-cn-document-for-docker:$VERSION
# docker tag rust-cn-document-for-docker ${{ secrets.DOCKER_USER }}/rust-cn-document-for-docker:latest
# docker push ${{ secrets.DOCKER_USER }}/rust-cn-document-for-docker:$VERSION
# docker push ${{ secrets.DOCKER_USER }}/rust-cn-document-for-docker:latest
# # Create Docker Image in Github
# - name: Login to GitHub registry
# run: echo ${{ github.token }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
# - name: Build docker image
# run: docker build -t ghcr.io/jaywcjlove/rust-cn-document-for-docker:latest .
# - name: Publish to GitHub registry
# run: docker push ghcr.io/jaywcjlove/rust-cn-document-for-docker:latest
# - name: Tag docker image (beta) and publish to GitHub registry
# run: |
# # Strip git ref prefix from version
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# # Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# echo "version: v$VERSION"
# docker tag ghcr.io/jaywcjlove/rust-cn-document-for-docker:latest ghcr.io/jaywcjlove/rust-cn-document-for-docker:$VERSION
# docker push ghcr.io/jaywcjlove/rust-cn-document-for-docker:$VERSION