Skip to content

Build Worker Generic Docker #13

Build Worker Generic Docker

Build Worker Generic Docker #13

Workflow file for this run

name: Build Worker Generic Docker
on:
workflow_dispatch:
inputs:
ref:
description: The commit SHA or tag for checking out code
default: ""
required: false
docker_tag:
description: The tag for the built docker image
default: "latest"
required: false
env:
WORKER_IMAGE_NAME: litentry/litentry-tee-dev
DOCKER_BUILDKIT: 1
jobs:
docker:
runs-on: ubuntu-latest
env:
working-directory: ./worker
steps:
- name: Checkout codes on ${{ github.event.inputs.ref || github.ref }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref || github.ref }}
fetch-depth: 0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ env.working-directory }}
file: ${{ env.working-directory }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.WORKER_IMAGE_NAME }}:${{ github.event.inputs.docker_tag }}