build: Limit deploy to master branch

This commit is contained in:
Martin Polden 2021-08-03 23:12:12 +02:00
parent 70c9a8cbca
commit 2b630f01a0
1 changed files with 17 additions and 13 deletions

View File

@ -8,21 +8,25 @@ on:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: build and test
run: make
deploy:
if: ${{ github.ref == 'refs/heads/master' }}
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.15
- name: build and test
run: make
- name: enable experimental docker features
run: |
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: publish multi-arch docker image
run: make docker-pushx
- name: enable experimental docker features
run: |
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: publish multi-arch docker image
run: make docker-pushx