Skip to content

build and push docker #11

build and push docker

build and push docker #11

name: build and push docker
on:
push:
tags:
- 'v*.*.*'
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
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: Build and push GWS amd64
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/gws-amd64/Dockerfile
push: true
platforms: linux/amd64
provenance: false
tags: |
gplates/gws:amd64-${{github.ref_name}}
ghcr.io/gplates/gws:amd64-${{github.ref_name}}
-
name: Build and push GWS arm64
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/gws-arm64/Dockerfile
push: true
platforms: linux/arm64
provenance: false
tags: |
gplates/gws:arm64-${{github.ref_name}}
ghcr.io/gplates/gws:arm64-${{github.ref_name}}
-
name: Build and push PostGIS amd64
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/gws-postgis-amd64/Dockerfile
push: true
platforms: linux/amd64
provenance: false
tags: |
gplates/postgis:amd64-${{github.ref_name}}
ghcr.io/gplates/postgis:amd64-${{github.ref_name}}
-
name: Build and push PostGIS arm64
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/gws-postgis-arm64/Dockerfile
push: true
platforms: linux/arm64
provenance: false
tags: |
gplates/postgis:arm64-${{github.ref_name}}
ghcr.io/gplates/postgis:arm64-${{github.ref_name}}
-
name: Create cross-platform images
run: |
docker buildx imagetools create -t gplates/postgis:${{github.ref_name}} gplates/postgis:amd64-${{github.ref_name}} gplates/postgis:arm64-${{github.ref_name}}
docker buildx imagetools create -t gplates/gws:${{github.ref_name}} gplates/gws:amd64-${{github.ref_name}} gplates/gws:arm64-${{github.ref_name}}
docker buildx imagetools create -t ghcr.io/gplates/postgis:${{github.ref_name}} ghcr.io/gplates/postgis:amd64-${{github.ref_name}} ghcr.io/gplates/postgis:arm64-${{github.ref_name}}
docker buildx imagetools create -t ghcr.io/gplates/gws:${{github.ref_name}} ghcr.io/gplates/gws:amd64-${{github.ref_name}} ghcr.io/gplates/gws:arm64-${{github.ref_name}}
#docker buildx imagetools create -t gplates/postgis:latest gplates/postgis:amd64-${{github.ref_name}} gplates/postgis:arm64-${{github.ref_name}}
#docker buildx imagetools create -t gplates/gws:latest gplates/gws:amd64-${{github.ref_name}} gplates/gws:arm64-${{github.ref_name}}