Skip to content

Commit 68351eb

Browse files
committed
add a initial CI
1 parent 796f4a1 commit 68351eb

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy mdBook site to Pages
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- es-translation
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
# Build job
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Install mdbook
26+
run: |
27+
mkdir bin
28+
curl -sSL https://github.com/RustLangES/mdBook/releases/download/v0.4.36-localization-v0.6/mdbook-v0.4.36-localization-v0.6-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
29+
echo "$(pwd)/bin" >> ${GITHUB_PATH}
30+
- name: Build with mdBook
31+
run: mdbook build
32+
- name: Copying the index
33+
run: cp ./index.html ./book/index.html
34+
- name: Upload artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
path: ./book
38+
39+
deploy:
40+
runs-on: ubuntu-latest
41+
needs: build
42+
steps:
43+
- uses: actions/download-artifact@v4
44+
- name: Deploy
45+
uses: cloudflare/wrangler-action@v3
46+
with:
47+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
48+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
49+
command: pages deploy ./artifact --project-name=go-book

0 commit comments

Comments
 (0)