Skip to content

Commit 91ce291

Browse files
committed
update github runner for self hosted
1 parent 5e7a71b commit 91ce291

File tree

2 files changed

+37
-31
lines changed

2 files changed

+37
-31
lines changed

.github/workflows/main.yml

+2-31
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust CI with deploy on master
1+
name: Basic Rust CI with checks
22

33
on:
44
push:
@@ -10,6 +10,7 @@ jobs:
1010
build:
1111
name: Build project
1212
runs-on: self-hosted
13+
if: github.ref != 'refs/heads/master'
1314

1415
steps:
1516
- uses: actions/checkout@v2
@@ -24,33 +25,3 @@ jobs:
2425

2526
- name: Build release
2627
run: cargo build --release
27-
28-
- name: Build documentation
29-
run: cargo doc --no-deps
30-
31-
- name: Upload compiled files
32-
uses: actions/upload-artifact@v2
33-
with:
34-
name: kafka-json-processor-target
35-
path: 'target/**/*'
36-
37-
deploy_doc:
38-
name: Deploy documentation
39-
runs-on: ubuntu-latest
40-
needs: [ build ]
41-
if: github.ref == 'refs/heads/master'
42-
43-
steps:
44-
- uses: actions/checkout@v2
45-
46-
- name: Download compiled files
47-
uses: actions/download-artifact@v2
48-
with:
49-
name: kafka-json-processor-target
50-
path: target
51-
52-
- name: Deploy to GitHub Pages
53-
uses: JamesIves/github-pages-deploy-action@v4
54-
with:
55-
branch: gh-pages
56-
folder: 'target/doc'

.github/workflows/with_deploy.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Rust CI with deploy on master
2+
3+
on:
4+
push:
5+
branches: [ 'master' ]
6+
pull_request:
7+
branches: []
8+
9+
jobs:
10+
build:
11+
name: Build project
12+
runs-on: self-hosted
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Install latest rust toolchain
18+
uses: actions-rust-lang/setup-rust-toolchain@v1
19+
with:
20+
toolchain: stable
21+
22+
- name: Test
23+
run: cargo clippy -- -Dwarnings && cargo test
24+
25+
- name: Build release
26+
run: cargo build --release
27+
28+
- name: Build documentation
29+
run: cargo doc --no-deps
30+
31+
- name: Deploy to GitHub Pages
32+
uses: JamesIves/github-pages-deploy-action@v4
33+
with:
34+
branch: gh-pages
35+
folder: 'target/doc'

0 commit comments

Comments
 (0)