Skip to content

Commit

Permalink
switch github action workflow to if condition for docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn Wenzel committed Oct 20, 2021
1 parent a510108 commit 2bb7ef2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 40 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/docker.yaml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,32 @@ jobs:
- name: Build with Maven
run: mvn -B package --file pom.xml -Dspring.profiles.active=test

docker:
name: Docker Build

runs-on: ubuntu-latest

if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: daspawnw/vault-crd:${{ steps.vars.outputs.tag }}

0 comments on commit 2bb7ef2

Please sign in to comment.