Skip to content

Docker base image

Docker base image #105

Workflow file for this run

name: Docker base image
on:
# rebuild image with updated patches each night:
schedule:
- cron: '0 4 * * *' # Runs every day at 04:00 UTC
workflow_dispatch:
# to test base image build in a pr:
# pull_request:
# branches: [ "main" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: 'mapforge-org/mapforge-base'
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Login against docker.io
- name: Log into registry docker.io
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./.github/Dockerfile.base
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max