Skip to content

Commit

Permalink
Merge pull request #102 from mormahr/new-docker-metadata-and-actions
Browse files Browse the repository at this point in the history
Extended tagging for docker images
  • Loading branch information
mormahr authored Aug 19, 2021
2 parents e32a7fc + 7cc1dfb commit 015d557
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: CI
on:
push
push:
branches:
- '**'
tags:
- '**'
# pull_request:
# branches:
# - '**'

jobs:
build:
Expand All @@ -15,12 +22,21 @@ jobs:

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v3
with:
images: mormahr/pdf-service
tag-sha: false
tag-custom: ${{ github.sha }}
label-custom: |
flavor: |
latest=auto
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=tag
type=ref,event=branch
type=ref,event=pr
type=edge,branch=main
type=sha,format=long
labels: |
org.opencontainers.image.vendor=Moritz Mahringer
- name: Login to DockerHub
Expand Down Expand Up @@ -59,7 +75,7 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
image: mormahr/pdf-service:${{ github.sha }}
image: mormahr/pdf-service:sha-${{ github.sha }}
options: -v ${{ github.workspace }}/coverage:/usr/src/app/coverage
run: |
python -m pytest \
Expand Down Expand Up @@ -95,6 +111,6 @@ jobs:

- name: Tag and push existing image as :latest
run: |
docker pull mormahr/pdf-service:${{ github.sha }}
docker tag mormahr/pdf-service:${{ github.sha }} mormahr/pdf-service:latest
docker pull mormahr/pdf-service:sha-${{ github.sha }}
docker tag mormahr/pdf-service:sha-${{ github.sha }} mormahr/pdf-service:latest
docker push mormahr/pdf-service:latest

0 comments on commit 015d557

Please sign in to comment.