Skip to content

Commit

Permalink
Proper docker image tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaceccanti committed May 12, 2021
1 parent f77c339 commit 3ab3924
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,33 @@ jobs:
steps:
- uses: actions/checkout@v2

- 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_PASSWORD }}

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images: indigoiam/voms-importer
tags: |
type=sha
type=semver,pattern={{raw}}
type=ref,event=branch
- name: Copy script to docker dir
run: cp vomsimporter.py docker

- name: Build Docker image
uses: docker/build-push-action@v2
with:
tags: indigoiam/voms-importer:latest
tags: ${{ steps.docker_meta.outputs.tags }}
context: ./docker
file: ./docker/Dockerfile
push: false

- name: Push docker image
run: docker push indigoiam/voms-importer:latest
labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ startsWith(github.ref, 'refs/tags/') }}

0 comments on commit 3ab3924

Please sign in to comment.