Skip to content

docker-buildimage-geoip2 #122

docker-buildimage-geoip2

docker-buildimage-geoip2 #122

name: docker-buildimage-geoip2
on:
schedule:
- cron: '15 4 * * 0'
push:
branches: [ main ]
paths:
- 'docker/geoip2/**'
- '.github/workflows/docker-buildimage-geoip2.yml'
jobs:
build-image:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWD }}
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
-
name: Set build date
id: build-date
run: echo "date=$(date +%F)" >> $GITHUB_OUTPUT
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: docker/geoip2/
file: docker/geoip2/Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
gsmlg/geoip2:${{ steps.build-date.outputs.date }}
ghcr.io/gsmlg/geoip2:${{ steps.build-date.outputs.date }}
gsmlg/geoip2:latest
ghcr.io/gsmlg/geoip2:latest
build-args: |
LICENSE=${{ secrets.MAXMIND_LICENSE_KEY }}
USER=${{ secrets.GIT_USER_ID }}
TOKEN=${{ secrets.PERSONAL_ACCESS_TOKEN }}
GOPRIVATE=github.com/gsmlg-dev/gsmlg-golang
CGO_ENABLED=0
DATE=${{ steps.build-date.outputs.date }}
-
name: Build and push embed
uses: docker/build-push-action@v5
with:
context: docker/geoip2/embed/
file: docker/geoip2/embed/Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
gsmlg/geoip2:embed-${{ steps.build-date.outputs.date }}
ghcr.io/gsmlg/geoip2:embed-${{ steps.build-date.outputs.date }}
gsmlg/geoip2:embed
ghcr.io/gsmlg/geoip2:embed
build-args: |
LICENSE=${{ secrets.MAXMIND_LICENSE_KEY }}
USER=${{ secrets.GIT_USER_ID }}
TOKEN=${{ secrets.PERSONAL_ACCESS_TOKEN }}
GOPRIVATE=github.com/gsmlg-dev/gsmlg-golang
CGO_ENABLED=0
DATE=${{ steps.build-date.outputs.date }}
# - uses: gsmlg-dev/send-tweet-v2-action@v1
# with:
# bearer-token: ${{ secrets.TWITTER_BEARER_TOKEN }}
# consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
# consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
# access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
# access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
# message: |
# A new version of GeoIP Docker image has been released!
# - docker.io/gsmlg/geoip2:latest
# - docker.io/gsmlg/geoip2:embed
# - ghcr.io/gsmlg/geoip2:latest
# - ghcr.io/gsmlg/geoip2:embed
# * Image with embed tag load data in memory.