Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 0d830b9

Browse files
committed
Migrated ci/cd to Github Actions
1 parent 9cda978 commit 0d830b9

File tree

6 files changed

+176
-17
lines changed

6 files changed

+176
-17
lines changed

.drone.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Feature Branch Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "feature/**"
8+
paths:
9+
- "src/**"
10+
- "src/api/**"
11+
- "src/server/**"
12+
- "**/Cargo.toml"
13+
- "**/Cargo.lock"
14+
15+
jobs:
16+
Build_Docker_Image_on_Push:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Setup Rust
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
components: rustfmt, clippy
25+
- name: Run Checks and Test
26+
run: |
27+
cargo fmt --all -- --check
28+
cargo clippy --all-features
29+
cargo test --all
30+
- name: Login to DockerHub
31+
uses: docker/login-action@v1
32+
with:
33+
username: ${{ secrets.DOCKER_USER }}
34+
password: ${{ secrets.DOCKER_PW }}
35+
- name: Build and Push Image
36+
run: |
37+
docker build . -t filefighter/ftp-service:feature
38+
docker push filefighter/ftp-service:featrue

.github/workflows/featureTests.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Tests (Feature)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "feature/**"
8+
- "renovate/**"
9+
paths:
10+
- "src/**"
11+
- "src/api/**"
12+
- "src/server/**"
13+
- "**/Cargo.toml"
14+
- "**/Cargo.lock"
15+
- ".github/workflows/featureTests.yml"
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Setup Rust
23+
uses: actions-rs/toolchain@v1
24+
with:
25+
toolchain: stable
26+
components: rustfmt, clippy
27+
- name: Checks and Tests
28+
run: |
29+
cargo fmt --all -- --check
30+
cargo clippy --all-features
31+
cargo test --all
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Latest Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
paths:
9+
- "src/**"
10+
- "src/api/**"
11+
- "src/server/**"
12+
- "**/Cargo.toml"
13+
- "**/Cargo.lock"
14+
15+
jobs:
16+
Build_Docker_Image_on_Push:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Setup Rust
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
components: rustfmt, clippy
25+
- name: Run Checks and Test
26+
run: |
27+
cargo fmt --all -- --check
28+
cargo clippy --all-features -- -D warnings
29+
cargo test --all
30+
- name: Login to DockerHub
31+
uses: docker/login-action@v1
32+
with:
33+
username: ${{ secrets.DOCKER_USER }}
34+
password: ${{ secrets.DOCKER_PW }}
35+
- name: Build and Push Image
36+
run: |
37+
docker build . -t filefighter/ftp-service:latest
38+
docker push filefighter/ftp-service:latest

.github/workflows/masterTests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Tests (Master)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "master"
8+
paths:
9+
- "src/**"
10+
- "src/api/**"
11+
- "src/server/**"
12+
- "**/Cargo.toml"
13+
- "**/Cargo.lock"
14+
- ".github/workflows/masterTests.yml"
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Setup Rust
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: stable
25+
components: rustfmt, clippy
26+
- name: Checks and Tests
27+
run: |
28+
cargo fmt --all -- --check
29+
cargo clippy --all-features -- -D warnings
30+
cargo test --all
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Stable Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
jobs:
8+
Build_Docker_Image_on_new_Tag:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Setup Rust
13+
uses: actions-rs/toolchain@v1
14+
with:
15+
toolchain: stable
16+
components: rustfmt, clippy
17+
- name: Run Checks and Test
18+
run: |
19+
cargo fmt --all -- --check
20+
cargo clippy --all-features -- -D warnings
21+
cargo test --all
22+
- name: Generate Image Tag from Git Tag
23+
id: vars
24+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
25+
- name: Login to DockerHub
26+
uses: docker/login-action@v1
27+
with:
28+
username: ${{ secrets.DOCKER_USER }}
29+
password: ${{ secrets.DOCKER_PW }}
30+
- name: Build and Push Image
31+
run: |
32+
VERSION=${{ steps.vars.outputs.tag }}
33+
docker build . -t filefighter/ftp-service:$VERSION -t filefighter/ftp-service:stable
34+
docker push filefighter/ftp-service:stable
35+
docker push filefighter/ftp-service:$VERSION
36+
- name: Create new release and tag.
37+
uses: softprops/action-gh-release@v1
38+
with:
39+
generate_release_notes: true

0 commit comments

Comments
 (0)