MNT: Switch to Github Container Registry (#168)

This commit is contained in:
Brendan Ward 2023-03-16 19:35:39 -07:00 committed by GitHub
parent f1414596b9
commit 1225e5c52c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

View File

@ -13,6 +13,10 @@ on:
- "go.sum"
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
buildx:
runs-on: ubuntu-latest
@ -33,21 +37,22 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: consbio/mbtileserver
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# add "type=ref,event=pr" if needed to test a PR
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
- name: Login to DockerHub
- name: Login to Github Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64

View File

@ -4,6 +4,7 @@
- now requires Go 1.18+.
- supports GCC11 on Ubuntu 22.04 (#166)
- switch from Docker Hub to Github Container Registry (#168)
## 0.9.0

View File

@ -237,10 +237,11 @@ server {
## Docker
Pull the latest image from [Docker Hub](https://hub.docker.com/r/consbio/mbtileserver):
Pull the latest image from
[Github Container Registry](https://github.com/consbio/mbtileserver/pkgs/container/mbtileserver):
```
docker pull consbio/mbtileserver:latest
docker pull ghcr.io/consbio/mbtileserver:latest
```
To build the Docker image locally (named `mbtileserver`):