-
Notifications
You must be signed in to change notification settings - Fork 17
37 lines (36 loc) · 1.41 KB
/
main.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
name: Continuous Integration
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
jobs:
report:
name: Report
runs-on: ubuntu-latest
steps:
- name: ref
run: echo ${{ github.ref }}
- name: event_name
run: echo ${{ github.event_name }}
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: '1.15.6' # The Go version to download (if necessary) and use.
- name: ci
run: make ci BUILD=local
- name: hub login
if: (github.event_name == 'push' && endsWith(github.ref,'/master')) || (github.event_name == 'create' && startsWith(github.ref,'refs/tags/'))
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: deploy # when merged into master, tag master and push - ideally, this would be a separate job, but you cannot share docker build cache between jobs
if: github.event_name == 'push' && endsWith(github.ref,'/master')
run: make cd CONFIRM=true BRANCH_NAME=master
- name: release # when based on a tag, tag master and push - ideally, this would be a separate job, but you cannot share docker build cache between jobs
if: github.event_name == 'create' && startsWith(github.ref,'refs/tags/')
run: make release CONFIRM=true