-
Notifications
You must be signed in to change notification settings - Fork 8
executable file
·60 lines (57 loc) · 1.81 KB
/
rustup.yaml
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
name: Build for rustup Doc
on:
# push:
# branches:
# - master
schedule:
- cron: '10 6 * * *'
workflow_dispatch:
repository_dispatch:
jobs:
build_and_deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Install mdbook
uses: actions-rs/install@v0.1
with:
crate: mdbook
version: latest
use-tool-cache: true
- name: Clone rustup doc
run: git clone https://x-access-token:${GITHUB_TOKEN}@github.com/rust-lang/rustup.git rustup-en
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: init oss config
uses: yizhoumo/setup-ossutil@v1
with:
ossutil-version: '1.7.3'
endpoint: ${{secrets.OSS_ENDPOINT}}
access-key-id: ${{secrets.OSS_ID}}
access-key-secret: ${{secrets.OSS_SECRET}}
sts-token: ""
- name: Build rustup book
run: |
# Build rustup book
mkdir -pv rustup-archive/{en,zh}
cd rustup-en/doc && \
mdbook build && \
ls -al && \
cp -ar book/* ../../rustup-archive/en/
# Upload to oss
ls -alhtr && \
cd ../../ && \
ossutil sync rustup-archive/ oss://${{ secrets.OSS_BUCKET }}/rustup/ -f --delete
- name: Sending Build Status
if: always()
env:
DINGTALK_ACCESS_TOKEN: ${{ secrets.DINGTALK_ACCESS_TOKEN }}
DINGTALK_SECRET: ${{ secrets.DINGTALK_SECRET }}
JOB_STATE: ${{ job.status }}
RUNNER_OS: ${{ runner.os }}
GITHUB_REF: ${{ github.ref }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_WORKFLOW: ${{ env.GITHUB_WORKFLOW }}
run: python3 notify.py