Merge pull request #142 from mpolden/limit-deploy

build: Limit deploy to master branch
This commit is contained in:
Martin Polden 2021-08-03 23:14:58 +02:00 committed by GitHub
commit 67f5a9e5a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 13 deletions

View File

@ -9,17 +9,21 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: install go - name: install go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.15 go-version: 1.16
- name: build and test - name: build and test
run: make 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:
- name: enable experimental docker features - name: enable experimental docker features
run: | run: |
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json