-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.15 KB
/
rust.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
name: Rust
on:
push:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- uses: actions/checkout@v2
- name: Update
run: cargo update
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
docker:
name: Publish docker container
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
steps:
- uses: actions/checkout@v1
- name: Calculate version
id: vars
run: echo ::set-output name=version_tag::$(cat Cargo.toml | grep version | head -1 | awk -F= "{ print $2 }" | sed -E 's/(version)|[=,\",]//g' | tr -d '[[:space:]]')
- name: Build & Publish
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: felixgail/musicbot-registry
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
tags: "latest,${{ steps.vars.outputs.version_tag }},${{ github.sha }}"