-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 1.07 KB
/
master.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
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Login to GitHub Docker Registry
run: docker login docker.pkg.github.com --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.GITHUB_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_DOCKER_PASSWORD }}
- name: tests
run: make test
- name: coverage
run: make cover
- name: run make, then build docker
run: |
make docker
docker build -t girc .
- name: tag image
run: |
# get current commit hash
commit=$(git rev-parse HEAD)
docker tag girc:latest docker.pkg.github.com/tehcyx/girc/app:latest
docker tag girc:latest "docker.pkg.github.com/tehcyx/girc/app:${commit}"
- name: push image
run: |
# get current commit hash
commit=$(git rev-parse HEAD)
docker push docker.pkg.github.com/tehcyx/girc/app:latest
docker push "docker.pkg.github.com/tehcyx/girc/app:${commit}"