Skip to content

Build and publish Docker image #4

Build and publish Docker image

Build and publish Docker image #4

name: Build and publish Docker image
on:
push:
tags:
- '*'
schedule:
- cron: "30 6 * * 1" # every monday at 06:30 UTC
workflow_dispatch:
jobs:
build_publish_docker:
if: ${{ github.repository == 'gboeing/osmnx' }}
name: Build/publish image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: gboeing
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
flavor: latest=auto
images: gboeing/osmnx
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./environments/docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'schedule' }}
tags: ${{ steps.meta.outputs.tags }}