Skip to content

geoip-api weekly release #199

geoip-api weekly release

geoip-api weekly release #199

name: geoip-api weekly release
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * WED'
jobs:
build:
runs-on: ubuntu-latest
steps:
- 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.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- id: determine-tag-and-build-date
name: Determine Docker tag
run: |
echo build_tag=$(date +%Y-%V) >> $GITHUB_ENV
echo build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") >> $GITHUB_ENV
- name: Build and push to DockerHub registry
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
build-args: |
MAXMIND_LICENSE_KEY=${{ secrets.MAXMIND_LICENSE_KEY }}
CREATED_AT=${{ env.build_date }}
VERSION=${{ env.build_tag }}
GIT_REVISION=${{ github.sha }}
tags: |
${{ github.repository }}:${{ env.build_tag }}
${{ github.repository }}:latest
${{ github.repository }}:latest-native
ghcr.io/${{ github.repository }}:${{ env.build_tag }}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:latest-native
create-release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- id: determine-tag
name: Determine Docker tag
run: echo "::set-output name=tag::$(date +%Y-%V)"
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.determine-tag.outputs.tag }}
body: |
Weekly release with updated geoip information
as of week ${{ steps.determine-tag.outputs.tag }}.
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}