Skip to content

Add rendering of the web into a directory #2296

Add rendering of the web into a directory

Add rendering of the web into a directory #2296

Workflow file for this run

name: CI
on: [ push, pull_request ]
env:
RUST_BACKTRACE: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Test
run: |
set -euo pipefail
# Check if the code is good
cargo build --all --locked
cargo clippy -- --deny warnings
cargo test --all --locked
- name: Formatting
run: cargo fmt --all -- --check
- name: Build website
run: cargo run
env:
BASE_URL: "/www.rust-lang.org"
- name: Configure GitHub Pages
uses: actions/configure-pages@v5
- name: Upload website
uses: actions/upload-pages-artifact@v3
with:
path: html
deploy:
needs: [ build ]
if: github.ref == 'refs/heads/master'
environment:
name: github-pages
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4