Skip to content

Publish Docker image #66

Publish Docker image

Publish Docker image #66

Workflow file for this run

name: Publish Docker image
on:
workflow_run:
workflows: Test
branches:
- "*"
types:
- completed
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
# v2.0.0
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
# v4.0.1
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a
with:
images: koinos/koinos-sdk
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
# v3.1.1
uses: docker/build-push-action@c84f38281176d4c9cdb1626ffafcd6b3911b5d94
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}