Skip to content

Commit 667e8d7

Browse files
committed
Add CI pipeline
1 parent b5c7db8 commit 667e8d7

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

.github/workflows/main.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: CI
2-
on: [push, pull_request]
2+
on: [ push, pull_request ]
33
env:
44
RUST_BACKTRACE: 1
55
jobs:
@@ -12,8 +12,7 @@ jobs:
1212
with:
1313
components: rustfmt
1414

15-
- name: Formatting
16-
run: cargo fmt --all -- --check
15+
- uses: Swatinem/rust-cache@v2
1716

1817
- name: Test
1918
run: |
@@ -22,3 +21,33 @@ jobs:
2221
cargo build --all --locked
2322
cargo clippy -- --deny warnings
2423
cargo test --all --locked
24+
25+
- name: Formatting
26+
run: cargo fmt --all -- --check
27+
28+
- name: Build website
29+
run: cargo run
30+
env:
31+
BASE_URL: "/www.rust-lang.org"
32+
33+
- name: Configure GitHub Pages
34+
uses: actions/configure-pages@v5
35+
36+
- name: Upload website
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: html
40+
41+
deploy:
42+
needs: [ build ]
43+
if: github.ref == 'refs/heads/master'
44+
environment:
45+
name: github-pages
46+
permissions:
47+
contents: read
48+
pages: write
49+
id-token: write
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)