-
Notifications
You must be signed in to change notification settings - Fork 81
51 lines (43 loc) · 1.63 KB
/
build.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
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.7'
cache: 'pip'
- name: Install requirements
run: |
pip install -r build-requirements.txt
pip install -r requirements.txt
- name: Run tests
run: ./bin/test
# https://github.com/coverallsapp/github-action
- name: Coveralls
uses: coverallsapp/github-action@master
if: github.repository_owner == 'randsleadershipslack'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: .coverage.lcov
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
if: github.repository_owner == 'randsleadershipslack' && github.ref == 'refs/heads/master' && github.event_name == 'push'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build image and push to Docker Hub
uses: docker/build-push-action@v2
with:
tags: |
randsleadershipslack/destalinator:latest
${{format('randsleadershipslack/destalinator:{0}', github.run_number) }}
push: ${{ github.repository_owner == 'randsleadershipslack' && github.ref == 'refs/heads/master' }}
- name: Create Github Release and Tag
if: github.repository_owner == 'randsleadershipslack' && github.ref == 'refs/heads/master' && github.event_name == 'push'
run: |
git tag v$GITHUB_RUN_NUMBER
git push origin v$GITHUB_RUN_NUMBER