Publish Docker image #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# For multi-arch | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- 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@v6 | |
with: | |
context: . | |
file: images/keria.dockerfile | |
platforms: linux/amd64,linux/arm64 | |
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 |