-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (43 loc) · 1.21 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: run cargo test
uses: actions-rs/cargo@v1
with:
command: test
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
- name: run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
docker:
runs-on: ubuntu-latest
needs:
- test
- clippy
steps:
- uses: actions/checkout@v2
- name: Build Container Image
run: DOCKER_BUILDKIT=1 docker build . -t ghcr.io/daniel0611/dhbw-dualis-discord:latest
- name: Log in to GHCR
if: github.ref == 'refs/heads/main'
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push Container Image
if: github.ref == 'refs/heads/main'
run: docker push ghcr.io/daniel0611/dhbw-dualis-discord:latest