Skip to content

Publish Docker image #3

Publish Docker image

Publish Docker image #3

Workflow file for this run

name: Publish Docker image
on:
workflow_dispatch:
inputs:
version:
required: true
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: weboftrust/keria
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker Layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: keri-${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
keri-${{ runner.os }}-buildx-
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: images/keria.dockerfile
push: true
tags: |
weboftrust/keria:${{ github.event.inputs.version }}
weboftrust/keria:latest
labels: ${{ github.event.inputs.version }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move Docker cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache