aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
blob: aea27d1bd192a40bcd90da564d4d7a03ce8f7cd2 (plain) (blame)
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
name: ci

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
      DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
    steps:
      - uses: actions/checkout@v2
      - name: install go
        uses: actions/setup-go@v2
        with:
          go-version: 1.16
      - name: build and test
        run: make
      - name: enable experimental docker features
        if: ${{ github.ref == 'refs/heads/master' }}
        run: |
          echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
          sudo service docker restart
      - name: publish multi-arch docker image
        if: ${{ github.ref == 'refs/heads/master' }}
        run: make docker-pushx