Skip to content

Building and publishing Docker image #6

Building and publishing Docker image

Building and publishing Docker image #6

Workflow file for this run

name: Build
run-name: Building and publishing Docker image
on:
push:
paths:
- Dockerfile
- src/*
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v2
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build an image and push it to the registry
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
${{ vars.DOCKERHUB_REGISTRY }}:${{ github.sha }}
${{ vars.DOCKERHUB_REGISTRY }}:latest