Skip to content

Build and Push Docker Image #103

Build and Push Docker Image

Build and Push Docker Image #103

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: stratumv2
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set image tags
id: tags
run: |
TAGS="stratumv2/sv2-ui:${GITHUB_REF_NAME}"
if [ "${{ github.event_name }}" = "release" ]; then
TAGS="$TAGS,stratumv2/sv2-ui:latest"
fi
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Build and push multi-arch image
uses: docker/build-push-action@v6
with:
context: .
push: true
file: Dockerfile
platforms: |
linux/amd64
linux/arm64
tags: ${{ steps.tags.outputs.tags }}