Build for Embedded Rust on Espressif. #199
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build for Embedded Rust on Espressif. | |
| on: | |
| # push: | |
| # branches: | |
| # - master | |
| schedule: | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| repository_dispatch: | |
| env: | |
| MDBOOK_VERSION: "0.4.28" | |
| jobs: | |
| build_and_deploy: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v2 | |
| - name: Download mdBook ${{ env.MDBOOK_VERSION }} | |
| run: | | |
| mkdir -p /tmp/mdbook | |
| curl -Lo- https://github.com/rust-lang/mdBook/releases/download/v${{ env.MDBOOK_VERSION }}/mdbook-v${{ env.MDBOOK_VERSION }}-x86_64-unknown-linux-gnu.tar.gz | tar -C /tmp/mdbook -xzv | |
| - name: Clone std-training book | |
| run: git clone https://x-access-token:${GITHUB_TOKEN}@github.com/esp-rs/std-training.git std-training-en | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Clone std-training book | |
| run: git clone https://x-access-token:${GITHUB_TOKEN}@github.com/Narukara/std-training-zh-cn.git std-training-zh | |
| 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 std-training book | |
| run: | | |
| # Build std-training book | |
| mkdir -pv std-training-archive/{en,zh} | |
| cd std-training-zh/book/ && \ | |
| /tmp/mdbook/mdbook build && \ | |
| cp -ar book/* ../../std-training-archive/zh/ | |
| cd ../../std-training-en/book/ && \ | |
| /tmp/mdbook/mdbook build && \ | |
| cp -ar book/* ../../std-training-archive/en/ | |
| # Upload to oss | |
| ls -alhtr && \ | |
| cd ../../ && \ | |
| ossutil sync std-training-archive/ oss://${{ secrets.OSS_BUCKET }}/book-rs/std-training/ -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 |