Skip to content

Docker error handling #6

Docker error handling

Docker error handling #6

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
paths:
- 'aws_spotter.py'
- 'docker/**'
- 'requirements.txt'
- '.github/workflows/docker-build.yml'
workflow_dispatch:
env:
DOCKER_IMAGE: pbdco/aws-spotter
PLATFORMS: linux/amd64,linux/arm64
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=raw,value=latest
type=sha,format=short
type=semver,pattern={{version}}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false