Skip to content

Commit

Permalink
Added docker tag publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwf committed Oct 19, 2021
1 parent 90611f3 commit c0ed53e
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Tasks API API Docker
name: Tasks API Release

on:
push:
branches: [main]
branches: ['main']
tags: ['v*']
pull_request:
branches: ['main']
paths:
- ".github/workflows/docker.yaml"
- "src/**"
Expand All @@ -20,6 +23,12 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/digirati-co-uk/tasks-api

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
Expand All @@ -31,6 +40,7 @@ jobs:
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
Expand All @@ -45,9 +55,9 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
push: true
tags: |
ghcr.io/digirati-co-uk/tasks-api:${{ github.sha }}
ghcr.io/digirati-co-uk/tasks-api:latest
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit c0ed53e

Please sign in to comment.