Merge pull request #839 from xizheyin/behind-upstream #3011
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: Deploy To GitHub Pages | |
| on: | |
| schedule: | |
| - cron: '0 22 * * *' | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| ci: | |
| name: CI | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install mdbook | |
| run: curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.48/mdbook-v0.4.48-x86_64-unknown-linux-gnu.tar.gz | tar -xz | |
| - name: Check blacksmith format | |
| run: cargo fmt --check --manifest-path=blacksmith/Cargo.toml | |
| - name: Build book | |
| run: ./mdbook build | |
| - name: Deploy book | |
| uses: rust-lang/simpleinfra/github-actions/static-websites@master | |
| with: | |
| deploy_dir: book | |
| github_token: "${{ secrets.GITHUB_TOKEN }}" | |
| if: github.ref == 'refs/heads/master' | |
| - name: Configure AWS credentials | |
| if: github.ref == 'refs/heads/master' | |
| uses: aws-actions/configure-aws-credentials@v1 | |
| with: | |
| role-to-assume: arn:aws:iam::890664054962:role/forge-rust-lang-org-ci | |
| aws-region: us-east-1 | |
| - name: Invalidate CloudFront cache | |
| run: aws cloudfront create-invalidation --distribution-id E12A3GKHZSREHP --paths "/*" | |
| if: github.ref == 'refs/heads/master' |