-
Notifications
You must be signed in to change notification settings - Fork 830
47 lines (40 loc) · 1.34 KB
/
build-publish-docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This workflow builds a Docker image from the repo's Dockerfile and pushes it
# to Docker Hub if the triggering event was a tag push. When it's a scheduled
# run, it just builds the image as a test, but does not push it.
name: Build and publish Docker image
on:
push:
tags:
- v*
schedule:
- cron: 50 4 * * 1 # every monday at 04:50 UTC
jobs:
build_publish_docker:
if: ${{ github.repository == 'gboeing/osmnx' }}
name: Build/publish image to Docker Hub
runs-on: ubuntu-latest
timeout-minutes: 90
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 tags 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 == 'push' && startsWith(github.ref, 'refs/tags') }}
tags: ${{ steps.meta.outputs.tags }}