-
Notifications
You must be signed in to change notification settings - Fork 19
77 lines (75 loc) · 2.65 KB
/
docker-build-and-push-edge.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: docker-build-and-push-edge
on:
workflow_dispatch:
push:
branches:
- master
env:
IMAGE_NAME: citygml-tools
PLATFORMS: linux/amd64,linux/arm64
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Parse short sha
uses: benjlevesque/[email protected]
id: short-sha
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: Checkout repo
uses: actions/checkout@v4
- name: Docker login Dockerhub
id: docker_login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.PLATFORMS }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.PLATFORMS }}
- name: Extract metadata (tags, labels) for docker image
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=edge,branch=master
labels: |
maintainer=Claus Nagel
org.opencontainers.image.authors=Claus Nagel
org.opencontainers.image.title=citygml-tools
org.opencontainers.image.description=citygml-tools is a command line utility that bundles several operations for processing CityGML files
org.opencontainers.image.url=https://github.com/citygml4j/citygml-tools
org.opencontainers.image.documentation=https://github.com/citygml4j/citygml-tools#docker
org.opencontainers.image.source=https://github.com/citygml4j/citygml-tools
- name: Build and publish
uses: docker/build-push-action@v6
id: docker_build
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}
build-args: |
CITYGML_TOOLS_VERSION=${{ steps.short-sha.outputs.sha }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}